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.

Adjectives · Adam Jacob says Ruby has “expressiveness”, Erlang is “glorious”, and that modern JavaScript is “becoming delightful.” Rust is “a powerful, deeply well thought out systems programming language”; Go is “an easy, approachable language with a strong and fabulous ecosystem.” Oh gosh; by comparison Java is, uh…

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 someString.equals(getType()) which went from working to always-silently-failing because autoboxing. Feaugh.

  • And (worst of all) java.lang.thread and shared-mutable-state. I wrote some 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 tomorrow.

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.



Contributions

Comment feed for ongoing:Comments feed

From: Mike P (Nov 09 2014, at 20:47)

What JDK version? You've been able to switch on a String since Java 7.

[link]

From: tkil (Nov 10 2014, at 00:18)

I really want to get past the "opinionated" bit of Go, but I just can't. It's not just opinionated: it's downright condescending. I want to punch my monitor every time I read the Go docs.

Throwing away three decades of established practice (types before names, types at all), then telling me that I'll "like it eventually".

I'm convinced that a large motivating factor is Rob Pike feeling that he deserves his own language, just like all his old buddies from Bell Labs. :(

[link]

From: another Mike P (Nov 10 2014, at 00:51)

It's not really autoboxing that's bothering you. It's universal equality.

[link]

From: Drazen Dotlic (Nov 10 2014, at 01:45)

A solid alternative to both Java on Android and Swift on iOS is Xamarin platform, which allows you to code in C# - a much more modern language than Java - on all platforms.

The UI isn't a least common denominator, it's native on each platform.

Is it as cool as some of the fancy new languages like Go or Rust? No, but it's basically Java done and evolved right.

It does have Microsoft stigma attached to it so most people won't even explore it; their loss I guess, I am basing all my mobile work on Xamarin.

[link]

From: billy (Nov 10 2014, at 05:25)

If you're wondering about what the 'swift' of android is, checkout kotlin: http://kotlinlang.org/

It's very similar to swift, written by jetbrains, and has excellent IDE support. Did I mention it can be used for android apps?

[link]

From: Ian Rae (Nov 10 2014, at 06:18)

And reliability -- when Twitter broke Ruby, their fallback was the JVM.

Akka is a Java technology that is legitimately cool.

But, yes, Go and Rust look sweet.

[link]

From: Gavin B. (Nov 10 2014, at 06:33)

> ... Erlang ...

Lets not forget Elixir the "simplified" Erlang hit version 1.0 recently

http://elixir-lang.org/

[link]

From: Madhukar (Nov 10 2014, at 11:12)

I think Scala will be Swift of Android[1]. Even Apple recognized it and recruiting scala developers to work on swift[2].

[1] http://blog.madhukaraphatak.com/scala-for-android/

[2] http://alvinalexander.com/photos/apple-job-posting-scala-and-play-framework

[link]

author · Dad
colophon · rights
picture of the day
November 09, 2014
· Technology (90 fragments)
· · Coding (98 more)

By .

The opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.

I’m on Mastodon!