Monday, August 17, 2009

Ruby is Java and Java is C

Remember 10 years ago? As "Java 2" (jdk 1.2) exploded in popularity throughout 1999, scores of developers dropped their perl/c CGI web server-side methods in favor of the new hotness Java. And why not? The language was maturing, the simplicity of ASP was ported to Java as JSPs in June, and the servlet spec was hammered out with the advent of WARs in August. Those of us lucky enough to get paid to be on this forefront found plenty of work still needed to be done - by way of tooling and optimization.

But with this new fervor of excitement rose an equal amount of riffing from the "real" server-side language: C/C++. "It may seem like you can write apps faster", they'd say, "but there's no way you can beat our tools - look at our libraries! Look at the power of our pre-processor, compile optimizations, and emacs! And - you'll be sorry when you have to spend all that time optimizing, and eventually re-write your code in C anyway." It was a fair argument, and there were certainly anecdotes over the years of companies pulling the plugin on their Java projects to revert back to C (hell, I worked on one at Cerner as late as 2004). Some Javanistas attempted to argue back - but most of us quietly hammered on, bending Java to our will - content in the knowledge that hardware would close the performance gap, and our tools would do nothing but grow. Yet still they scorned - for a while. Ten short years later, you rarely hear from that camp anymore concerning web server-side productivity or reliability. We clearly - emphatically - won. (It's a shame, really, since I kind of miss hacking C.)

But times have changed. Despite incessant claims that Moore's law is dead - it has held strong, driving forward. Hardware is cheap. Disks are cheap. Memory is cheap. And in many systems, bandwidth is cheap. Yet now, a short 10 years later, the Ruby camp suffers the slings and arrows of a myopic community - in this case Java steps into the role of C. The old, general purpose stand-by refuses to fade away in favor of it's lighter, easier, friendlier replacement. The arguments levied against Ruby these days are similar to the old arguments against Java. It's slower. It doesn't have powerful tools. It doesn't concern the needs of the "enterprise". "Real" programmers understand the difference between interfaces and abstract classes - and the value of each being distinct (I still don't know). Yadda yadda yadda...

So I'll make two predictions here. Not so bold now, but in fairness to me, I've been saying it for 4 years: Ruby will win this battle for the web over Java. Java is just too clunky of a language to survive, with too much baggage to match the agility of Ruby - or even Python for that matter.

Java - desperate to remain relevant - has at least learned something from the past. Java, as a language will die, but hopefully the JVM - arguably the greatest VM ever created (not so much by design, but by sheer effort alone) won't fade into that dark night. Hopefully EngineYard's recent investment into JRuby is just the right medicine - lest it completely drop from the web server-side market. And that really would be a shame.

1 comment:

Itay Maman said...

People often think history does not repeat it self. In this case, I agree with you: the "push the dominant language away" cycle is back.