I just read Adam Jacob’s Rust and Go, comparing two new hotnesses. Me, I’ve been (unaccustomedly) working the last few months in a familiar codebase/toolset, on an Android app; so I thought I’d add an “…and Java.”
Is Java boring? · Android is the only place where Java isn’t boring. The big back-end systems at Google and the other Net giants are the only other places where new Java code might change your life; and most developers aren’t writing those.
Interesting new server-side code is in Node and Go and Rails and Erlang and so on. Maybe Rust too, soon.
Mobile apps are still interesting, and half of them, more or less, are Android/Java things. There’s new tooling: Android Studio, based on IntelliJ and Gradle. There are new APIs, both from Google and in a pretty lively open-source ecosystem. There are interesting new kinds of apps being built; watch the headlines.
Well, I can get shit done. The tooling is pretty decent and when I’m programming against a huge API surface (like you always are in mobile apps), the IDE fills in the boilerplate; its guesses about which method I need to call, and which arguments to give it, are frighteningly good. When it won’t compile it tells me why and, once it does, since this sort of API tends to be pretty well-debugged, the code usually runs first time.
And that code runs pretty fast, too.
For a twenty-year-old tool, Java is actually lasting better than anyone could have hoped. Do I actually like it? No, but I can’t honestly say it’s getting in my way, mostly.
Particularly since, on mobile, I can mostly avoid the dependency-injection Stockholm syndrome.
Gripes · Let’s be balanced here.
All these years later, generics still suck. Nuff said.
Auto-boxing is pernicious. I changed the
type field of an
object from a String to an int so I could use
switch on it, and
there was code out there that said
which went from working to always-silently-failing because autoboxing.
And (worst of all)
shared-mutable-state. I wrote
of that wait/notify code recently and it’s worked so far pretty well, but
I’d be unsurprised if it started exhibiting an intermittent hard-to-find bug
s/Java/?/ · So, for Android development, would we be better off in Go or Rust or something? Yes, I think I would, starting five or ten years after the switchover, when everything else caught up. If I were in the Android group, would I be wondering what its equivalent of Swift should be? Yep.