Money-Oriented Programming

Overview

Java attracts a lot of critism, often because it the over-hyped product of a commercial company rather than a language rooted in "higher" ideals. I argue that the Java platform is better because of its commercial nature.

Java Sucks

I spent several months programming in Java. Contrary to its authors prediction, it did not grow on me. I did not find any new insights - for the first time in my life programming in a new language did not bring me new insights. It keeps all the stuff that I never use in C++ - inheritance, virtuals - OO gook - and removes the stuff that I find useful. It might be successful - after all, MS DOS was - and it might be a profitable thing for all your readers to learn Java, but it has no intellectual value whatsoever. Look at their implementation of hash tables. Look at the sorting routines that come with their "cool" sorting applet. Try to use AWT. The best way to judge a language is to look at the code written by its proponents. "Radix enim omnium malorum est cupiditas" - and Java is clearly an example of a money oriented programming (MOP). As the chief proponent of Java at SGI told me: "Alex, you have to go where the money is." But I do not particularly want to go where the money is - it usually does not smell nice there.
An Interview with Alexander Stepanov

Alexander Stepanov doesn't like Java. In case you don't know who he is, Stepanov is the principal author of the C++ Standard Template Library (STL). One thing that always annoyed me about C++ in 1994 was that there wasn't a standard set of containers that came as part of the standard library. STL provides these containers and a lot more, in fact it is better to say that STL and the resulting changes to the C++ standard facilitate a whole new style of programming called "generic programming". STL provides a several sets of orthogonal components that can be extended and combined together without limitation. It is a work of creative genius and shows a deep understanding of the nature of software.

Bearing all this in mind you can see why Stepanov doesn't like Java. The expressiveness of the STL would be impossible to achieve in Java. People have tried though. Objectspace wrote a library called JGL which gained some popularity with Java coders and Stepanov himself produced an SGI sponsored version of STL in Java. Needless to say these libraries are pale imitations of the original.

So you can't do generic programming in Java. Who cares? Well, for a start I care. I'd love to able to use something as expressive as STL in my work but I can't. Another question might be "does it matter?". Experience suggests that the answer is probably "no".

Completeness and Correctness

When Java originally appeared it only had a handful of collection-related classes. The central ones where Vector and Hashtable. The whole set wasn't anywhere as good as the STL but people used them and moaned about them but generally they didn't feel the need to remedy the problem. Some developers used JGL, but most probably didn't. In Java 2 the collection framework was revamped and improved. Again, it wasn't STL (and all the time Java doesn't have parameterized types it won't be) but most people have stopped moaning now.

This leads to my first point. The C++ community has spent a lot of energy getting the basic language and library "right". People still complain it is too complex, but libraries such as STL show that at least that the standard makers have thought long and hard about the problems. Unfortunately this has given them very little time to think about everything else like garbage collection, security, user interfaces and the like. All this has to be left to the commercial companies like Microsoft and Borland to fill the gap. C++ is "correct" but "incomplete". There is only a limited set of applications you can produce with standard C++.

Sun though have realised that it is more important to be able to write complete applications than to have a language that pleases academics. Most software is not written in universities but in companies. Companies just want to get the job done, they don't care about how expressive their programming languages are. For them "completeness" always beats "correctness".

By focussing on what commercial operations want rather than getting too hung up about syntax, Sun has created a language that has leap-frogged C++. And now that Java is successful Sun can now fix the most glaring errors at their leisure, as they did with collections.

Java is the New Cobol

Java is the new Cobol. It has sold its soul to business. Its development is driven by money rather than aesthetics. Fortunately that means that we can achieve more with Java in less time than we ever could with languages rooted solely in standards and academia. It is an uncomfortable truth, but it is one I'm happy to live with. It may not smell nice here but I like it.


History

Date Version Comments
9/3/01 1.0 First draft.

Up: Ian Fairman's Writings
Copyright Ian Fairman 2001 - ifairman@yahoo.com
1