Ask HN: Why is “advice in Effective Java considered inappropriate for Android”?
I came across this statement on Dagger's documentation at [http://google.github.io/dagger/android.html]. Also there is a discussion on reddit [https://reddit.com/r/androiddev/comments/4smncj/is_this_true/] but it does not cover much.
7 comments
[ 5.6 ms ] story [ 32.0 ms ] threadIt uses java syntax, java libraries.
To say it is 'not Java' is borderline disingenuous.
Technically, there are differences which are real, and it's very fair to point them out.
But - Java syntax + java.lang/java.io/java.net/java.reflect/java.util + a vm, can use a JAVA IDE and java build chain, use 3rd party java libs ...
=> it's java.
It uses Java as the development language, but it has different runtime, not simply a different platform / target, and thus different rules apply.
In regards with the Java libraries, I think this is pretty much already covered in the Google vs Oracle case. Android provides a system implementation that matches the interface, thus these code can work almost seamlessly. Similar to how .NET and Mono works.
Syntax = Java Standard Libs = Java 3rd Party Libs = Java Fully interoperable with Java Java IDE's Java Toolchain
= It's Java.
There can hardly be a pragmatic argument against this.
The Google case is a weird one that ultimately involved the nature of APIs and if they can be copyrighted, but by any reasonable definition ... it's Java.
Note that they don't give it 'another name' - so what programming language do you use for Android?
Ask 1000 developers and they will say 'Java'.
They won't say 'something that is exactly like Java, but not actually Java, and which has no name'.
If they deviated the syntax, used a totally different set of core libs, wasn't interoperable with other JVM's and libs ... then I think we could say 'it's not java'.
Generally, I would say follow the advice in Effective Java, but be aware of some potential performance issues and how you can avoid/fix them if need be.
Edit: I noticed there is a chapter on serialization. This can be ignored by Android developers in favor of Parcelable.