In Pursuit of the One True Programming Language

Java logo¬†Cringely had an interesting take on Java. I must confess, I love Java, warts and all. And while it has been awhile since I really got involved with Java development, I’ve watched from afar and seen that more of its issues are being worked out. I think the thing that drew me to it in the first place was the potential of ‘write once, run anywhere’. I say potential because it was never really a reality. Java is still solid on the enterprise server but then that was never really the issue. ‘Write once, run anywhere’ was supposed to be the promise for client developers to be able to create an app that was truly cross platform. And it works to a point, but still there are problems.

In any event, Cringely clarifies his position that it’s the JVM and its potential resurgence that he is considering. i.e. having a single platform which provides solid performance and good flexibility across platforms so that you can target that and call it a day. Moreover he ties that performance in with the promulgation of SSD over HDD and the fact that the bottleneck will cease to be database seek times due to hardware inefficiency and simple runtime inefficiency due to platform. His comparisons are mostly to Ruby but apply to any interpreted language. He notes that the JVM provided threading and memory management at a time when it was mostly done with greater difficulty with existing tools (e.g. C++) at the time.

C++ has been getting more of these features, whether through add-on libraries or through language updates. It is supported on almost any platform you care to mention. What C++ lacks is the enforced standardization of things like data types (which are still in some cases hardware implementation dependent for C++ but have set size definitions in Java) and UI frameworks. There are C++ frameworks which are cross platform capable and allow for a single application to be built for any supported environment but as with Java they must target the lowest common denominator in terms of functionality, often lag behind native enhancements and still do not typically look quite like they “belong” since there is usually a noticeable difference from native apps.

The point here is that C++ is not far behind Java in terms of offering many of the comforts which the JVM provides. Note I say the JVM. It is the JVM and the backing libraries which provide all of the functionality. The Java language is just a front end. JRuby is an example of being able to target the JVM with a language other than Java. Which still ties in with Cringely’s point. But here is where I differ.

I don’t think the JVM will see a resurgence, as much as I might like it. The biggest point Cringely seems to be making is that as more emphasis is put on CPU performance because disk performance improves enough to make seek times negligible, the JVM will see more projects in lieu of things like RoR and CakePHP. I disagree though. Right now the JVM is already available for those projects for whom performance is so key that it is needed. Right now, database performance is a common factor among all web server implementations. Put another way, optimizations for database access affect all implementations roughly equally. So again, any optimization happening now is still going to determine your deployment language. That won’t change with database performance increasing. If anything, it might even make those scripted languages more useful because you’ve already cut some of the performance bottlenecks and you can afford a little more slack on the logic performance.

Additionally, as C++ evolves, it seems to be closing the gap in the number of toys you enjoy with Java. So the ease of development is decreasingly an issue. Which means you can get your performance gains, with possibly more deployment options, and equal development ease, by switching to C++ in lieu of Java. Not now perhaps but in the timeframe Cringely is considering for JVM uptake.

And while OS X is still not a majority market share, it’s numbers are increasing. And Java is in a somewhat nebulous state at the moment. Apple has deprecated their JVM. Java apps are not allowed in the Mac App Store nor on iOS. Oracle has announced Java 7 but has not announced a timetable for availability on OS X. That’s a big hole.

All in all, I would love to see Java make a comeback and be more widespread than ever. I truly enjoy developing with it. I just don’t see it in the cards.