Jiri Lundak

Archive for September, 2006|Monthly archive page

Explicitness Going Down the Drain in Java

In Programming on September 6, 2006 at 12:50 am

There it goes down the drain: The wonderful explicitness of the Java programming language.

Do not missunderstand me. No, Java is not the mother of all languages. It was, in its beginning, just a very easy to learn language, with a tightly integrated language core, and with a growing set of more or less powerful libraries, that could very easily extend the language’s usefullness to many areas.

Sure, primitive data types (like int, boolean and long) were a bad choice. Making everything an object would have been more appropriate (as in Smalltalk et al.) and would have given Java the possiblility to be not just an easy way to learn a programming language but an easy AND elegant way to learn it.
But we just plain missed on that chance. Instead we introduce constructs and syntactic sugar to the language core, that mess things up, make the language more complicated, more obscure, doing magic things, that – instead of giving us transparency and a clean concept to build on – just make programming harder and more error-prone. See one terrible example here in this blog entry.

Is it time to say goodbye to Java? I think not yet really. There are still too many Java libraries out there that make it worth messing with Java!

So what can we do about the new Java language features? Well, just say no to autoboxing et al. and go explicit again! What do I mean by explicit? See this old JavaWorld article about an explicit programming style, and why to prefer it.