OpEd: Yammering about Scala, Java, and Winning

by
Tags: , , , ,
Category:


This is an opinion piece that represents the views of the author, and does not represent the official stance of Chariot Solutions. But sometimes it is fun to weigh in on the news of the day.

There has been quite a dust up in the blogosphere about Yammer’s decision to switch from using Scala to Java. Google “yammer switching to scala” and you’ll get a sampling. You can read it for yourself, but the gist of story seems to be that Yammer, the self described “enterprise social network” e.g. private label Twitter, decided to move their development from Scala to Java. The Scala guys at Typesafe heard about this (disclosure: Chariot Solutions is a Typesafe partner), and privately asked Coda Hale, infrastructure architect at Yammer, the reasoning behind the move. Coda responded in another private-but-soon-made-public email. It is a very long and detailed email, but in summary:

“The essence of it is that the friction and complexity that comes with using Scala instead of Java isn’t offset by enough productivity benefit or reduction of maintenance burden for it to make sense as our default language.”

Then Hale clarified the purpose of his email and Yammer clarified their official position on Scala.  Yammer’s decision has (re)ignited the debate over whether Scala is better or worse than Java.  If you read the comments section of this blog post from Stephen Colebourne, you get the general gist but here is a sampling that I can reprint and still keep this blog “family friendly”:

In favor of Scala:

Some pretty serious masochists out there at Yammer. I wonder if their investors know about it.

Not in favor of Scala:

The code and build process was a rat’s nest of pain and people should avoid using scala at all costs on any commercial project where these things can become a big issue.

I’ve used and learned lots of different languages but can’t recall anything more painful than scala. Cross compiling and maintaining c codebases with native ui on different Linux/winblows envs was easier and less traumatizing than this. It’s fine for academic pursuits and personal projects but you’re smoking some serious crack to try and justify it commercially.

Opinion #1: Java is winning (like Tebow not Sheen).

The biggest thing that I take away from this whole incident is that Java is winning.  I don’t mean Java is winning vs Scala or that Java is better than Scala.  I mean that Java is, in my opinion, an aging language with many quirks, with a fairly dysfunctional governing body in the JCP, and a yet-to-be-fully-trusted new caretaker in Oracle, full of the baggage of vendor compromises which nearly ruined JEE, and faces many very strong competitors on the JVM itself like Scala, Groovy, and Clojure, and yet — against all odds and in very Tim Tebowesque form — is winning over highly skilled engineering shops like Yammer.

I’ve been a Java programmer for 10+ years and there are many things about Java that irritate me like the slew of boilerplate code that you need in every single class.  But while innovation in the language itself can only go so far while still maintaining backward compatibility, innovation in the wider Java community is still thriving.  Java may not be the best language out there, but the battle tested JVM runtime combined with the countless mature open source tools and frameworks make the Java ecosystem as a whole arguably the richest one on the planet.

For a while I was convinced Java was the new Cobol: a language past its prime which due to its huge popularity will never die out completely, but not on the short list of candidate languages for a green field project.  Now I’ve changed my mind.  Java has its warts but there is value in maturity, and it still can compete head to head with any language ecosystem out there.

Opinion #2: Scala is winning too.

Yes, Yammer moved from Java to Scala, but they make explicitly clear that they like Scala too.  It is just that Java make more sense for them and their specific business needs.  Yammer was able to build an impressive high volume system with a small engineering team using Scala.  One shop moving away from Scala does not constitute a trend.  Scala has a relatively young ecosystem but already some very impressive open source projects like Akka.  I expect the combination of Jonas Boner and Martin Odersky together in a single company to provide a real boost to Scala.

I’ve never used Scala on a real project but I’m in love with the syntax and what you can do with the language.  I know people who use it all the time and love it as well.  Scala is undeniably more complex than Java but with the complexity comes more power.  Scala isn’t better or worse than Java.  It is just different.

Opinion #3: Polygot is hard.

I really like the idea of polygot programming: pick the programming language that fits your problem space.  I worked with many large clients that solve every problem with the same Java stack even when it is obviously a bad fit.  But one of the things that Hale mentioned in his email was that the choice for Yammer wasn’t between Scala and Java, it was between Scala/Java and Java.  The context switching caused by thinking in multiple languages was a drag on the team.  When you think about it, a programmer is required to know many languages just to build a basic web app using a Java stack: Java, SQL, HTML, Javascript, and CSS.  Adding more languages to the mix makes things that much more complex.  Then you also include build tools, language idioms, and the ecosystem of libraries and frameworks.

I work in both Java and Groovy, and I find those languages similar enough to minimize the difficulty of context switching, but I can imagine switching between diverse languages like Java and Clojure might make my head explode.

Opinion #4: Coda Hale is a humorous writer

Not everyone can write about techie stuff and make it humorous and informative.  Here is a quote from his blog post that made me chuckle:

“The Scala community needs another giant blog post about ways in which someone doesn’t like Scala like I need a hole in my head, and I’d rather suck a dog’s nose dry than lend a hand to the nerd slapfights on Hacker News.”

I was pleasantly surprised to find that Hale is speaking at my company’s annual technology conference Philly ETE.  That’s one session I’ll be attending.

And I might just ask him if Scala is better than Java 🙂