The Second Coming of Java
I read an article entitled The Second Coming of Java: A Relic Returns to Rule Web today and found myself annoyed for a number of reasons.
I know Wired is aimed at the lay person who is interested in technology so I don’t expect to read the kind of minutiae that programmers work in but I also do not expect to read an article which presents such a weird retelling of events that I do not recognise the industry in which I have been working for all these years.
Maybe I should shrug it off and ignore it. The problem is that there are a set of people who will accept it and eventually I’ll meet one of them who wants to bore me in the pub about how Java is killing Ruby or some other tosh that they have concluded on the basis of an article in Wired.
If it were just pub-going nerd-bores I would be okay. Unfortunately it’s probably not limited to them. I imagine these articles are where a lot of the misinformation gets spread to people who, whilst not deeply technical, have control over decisions regarding technology choice in some companies.
So, here is my quick, dirty, incomplete, mainly-from-memory rebuttal to some of the points in the article. Wired needn’t worry, no-one reads this anyway but I’ll feel better once I’m done.
Where did Java go? When? I have been using it since it was released and from at least 1998 on back-end servers having nothing to do with personal computers, home appliances or mobile devices that Sun attempted to initially target.
We techies very quickly realised that it was kind of like a simpler C++, with native threading and garbage collection. That trifecta was enough to make a lot of people very keen to use Java…well, if you had experience with C++ it did.
What I am saying is, it never went away…you may not have heard about us using it but that ain’t my fault bub.
To Rule The Web
First of all, what does it mean to ‘To Rule The Web’? The most deployed language for web site creation? The most deployed on the fortune 500? The most deployed by start-ups?
The article does attempt to distinguish between the JVM, Java and other languages that also run on top of the JVM so maybe they are implying that the JVM is becoming the back-end platform for web sites. Either way, stating that the JVM or Java is ruling the web seems like opinion rather than fact.
Let’s look at some numbers.
The TIOBE Programming Community Index shows us information regarding the relative popularity of languages. Java is high up there, Ruby also features. Scala and Clojure just don’t have enough people using them yet to break the top 20 which still includes COBOL, pilloried by all as an abomination to work with.
As of today Scala gets a mention at number 42 with 0.3% share.
This is unfair though, these numbers are not segmented by industry. We really need to look at numbers for web sites only.
Before we leave these numbers though it is interesting to point out that the Java ranking is very obviously trending downwards in the TIOBE index.
Looking at wikipedia might help. As of today there are 14 sites listed, of whom 7 (50%) show some Java usage and 2 (14%) some Scala usage. That is a tiny sample size though, and I haven’t found anything more compelling to look at.
If Java rules the web I want to know what Wired are basing their conclusions on, except that it makes a more compelling article.
Move To Java
In the second act Wired describes how Twitter moved from Ruby on Rails to Java, Scala and Clojure. Implying that the performance gains were due to the switch to JVM based languages.
Now, see, this is where it gets really dicey.
If we believe the following;
“Originally, Twitter was one, monolithic application built with Ruby on Rails. But now, it’s divided into about two hundred self-contained services that talk to each other.”
Then quite frankly the choice of language may not be all that important.
You could take a monolithic application written in any language, break it down so that it scales horizontally across servers and vertically to provide separate systems that communicate with one another in exactly the same language you started with and end up with a system that is…*drumroll*…faster, more scalable and less prone to crashing.
So I don’t buy the line that Java or the JVM saved Twitter. I would bet that a thorough re-architecting of their system saved Twitter. I’d be glad to update this based on Twitter devs first-hand knowledge but I’d already happily put some money on the architecture being more important than the language, it nearly always is.
Does the JVM provide better raw performance than Ruby? Yeah, okay, you got me, it does. So let’s also mention that one of the languages that runs on the JVM these days is Ruby, and it gets a performance boost when run there.
Another data point to add to all this is that Twitter are hiring, in fact I got a job spec from them exactly two weeks ago today. Senior Software Engineer, Java, Scala, Ruby…so they clearly haven’t excised Ruby from their systems, maybe they just run it on the JVM now. Hmm.
After some discussion of the benefits of a service oriented architecture to Twitter’s operations we get to hear that;
“But so much of this trend is driven by the JVM — and its ability to run more than just the Java language.”
The “trend” in question I can only imagine is the service architecture they are talking about, and I am going to assume that is what they meant from now on.
Now I really want to know what they are implying here. That service oriented architectures are being driven by the ability to use multiple languages on the JVM? If so, what kind of crack is being smoked in the Wired offices?
I haven’t worked at every tech company in the world, that would be impossible. I have worked for quite a few though. In that time I have never. Ever. Never, ever, ever, ever been in a meeting, email conversation pub chat or water-cooler moment where someone suggested we should use the JVM because we can run multiple languages on it, nor that it would allow us to move to a service oriented architecture.
As fertile an imagination as I posses I cannot see how you conclude that service oriented architectures are being driven by the ability to run multiple languages on the JVM. Answers on the back of a postcard please. Seriously.
Now, I am willing to bet that there are one or two companies out there where people have said they should use the JVM because they wanted to slip Scala, Ruby or Clojure into the company under the radar. I don’t see this has any logical connection to service oriented architectures though.
It’s pretty important that all your developers can work on the code-base. Vital one might say, so this gem poked me in the eye when I read it.
“And unlike the Rails programming framework, Java and Scala let Twitter readily share and modify its enormous code-base across a team of hundreds of developers.”
I would absolutely love to know what it is about Rails that Twitter found stopped them from working on it together. Please, if you work there, I am dying to know.
Perhaps you’re talking about factoring tools? Maybe? I don’t see how that stops people from working on it together though.
Source code control doesn’t care what language you write in, and that is the main tool we use to allow multiple people to collaboratively modify code so I’m feeling stumped.
It is 3am now, maybe I’m tired, anyone with a good idea let me know.
Okay, I’m done. If I could make the article disappear so that no CTO ever saw it I would.
Twitter took the very sane and well-trodden path of going from a language that is quick to write to one that is quick to run and the Wired article doesn’t seem to discuss those trade-offs, nor that only a very small number of sites will ever be large enough to have Twitter’s scaling problems.
More importantly Twitter re-architected their system when they found performance problems and the amount of credit for saving their skins and banishing the fail whale given to it rather than moving to JVM based languages seems plain wrong to me.
UPDATE: Hacker News Discussion
27 September 2013 - wired jvm java ruby scala twitter