JVM: A New Frontier
The Java Virtual Machine debuted around 1995. People who are old enough to remember Netscape probably remember very first Applets and claims of how embedded Java bytecode was going to change the world order and eradicate world poverty.
Poor applet died with Netscape and died again when Internet Explorer refused to bundle the JVM.
But JVM lived on and after years of optimizations, it’s probably the best Virtual Machine around. Some benchmarks give it an edge over C++ which is not hard to explain since even memory leak free C++ code suffers from memory fragmentation. But, I’m excited again with the JVM for an entirely different reason. While Java was better and cleaner and simpler than C++, it was still quite verbose. Dynamic Languages like Perl, Python and Ruby offered terseness and expressiveness unknown to the Java Programmers. CPUs got faster. Good Programmers got more expensive. It made sense to trade CPU time for programming time. Why waste time writing 10 lines of java code when an one liner Perl would do the same thing? Number of bugs is directly proportional to the number of lines of code. Less code is better code. For years, the Java world (and the Microsoft world) tried to hide behind ever more complex tools like Eclipse, Netbeans and Visual Studio. Tools might be nice but they rot the programmers’ mind. They dumb them down and provide a false sense of simplicity. Hiding a Language’s complexity behind even more complex tools is a terrible idea.
I know of many highly paid Microsoft programmers who copied Visual Studio generated DCOM code around without understanding what was it doing. The technology was so darn complex that hardly anyone understood the guts of it.
So, why am I beginning to like Java again?
It’s not really the Java Language itself. It’s the new crop of JVM based higher level languages that have cropped up recently, that make me believe in this Virtual Machine again. Take a look at Scala, Groovy and JRuby. All based on the JVM and all are modern languages with the same expressiveness that I’ve come to like in Ruby and Perl. Best of all, these langauges conform to the Java bytecode! The entire Java Library is instantly available to these languages. No need to wait for your favorite Java Library to get ported to any of these. Given the fact that almost every library has already been ported to Java, it means, you can have your cake and eat it too.
Ruby is beautiful and fast moving. But Scala is beautiful, fast moving and is super rich with libraries!
Finally, we can truly start using the right tool for the job.
The pervasiveness of JVM means truly mobile code is now a possibility. Imagine code snippets written in Plain Old Java and Scala and Groovy and JRuby being shipped over the Internet for remote execution! Netscape and Applets live on!!
