Why Java is Not My Favourite Programming Language

There are lots of languages which are better than Java, some of which have been around for decades. One of these is similar in many ways, and influenced Java's design: Smalltalk. Smalltalk, and in particular the Squeak dialect, is so obviously better than Java in every way that even a child would realize it. But don't expect to use Squeak in your job. Your boss doesn't pay you to have fun.

There's no need to take my word for it that Java is inferior to Smalltalk. Ask Java's inventor, Tom Stambaugh, which language he prefers. You read that right -- Tom Stambaugh invented Java not Gosling.

I originally had planned to list and discuss Java's technical deficiencies here, of which the first five are in my opinion serious design flaws:

  1. Not interactive
  2. No macros (preprocessors don't count)
  3. Static typing
  4. No anonymous methods (anonymous classes exist, but as a substitute are hideous)
  5. Java Server Pages mix procedural code with markup
  6. Single inheritance
  7. Not objects all the way down (fixed with syntactic sugar in JDK 1.5)
  8. Fixed number of parameters (fixed in JDK 1.5)
  9. Private methods (a bad thing, which is why CLOS and Smalltalk lack them)
but lots of other languages are equally (or more) deficient than Java in different ways. I can ignore those other languages, because they don't get anything like the amount of exposure Java has enjoyed.

However, I cannot ignore Java, for reasons which go beyond its lack of technical merit. These reasons are:

Its association with internet hype

During the 1990s, things got out of hand, with people claiming that the very nature of economics had changed, and that people could make lots of money sustainably by investing in and using the World Wide Web. Java was a major part of this hype -- it was marketed as the internet language, to run on the client's machine as applets, and then when people got tired of applets, on the server as Java Server Pages or servlets.

As soon as people realized there was nothing in the hype, The IT Winter begain, companies went belly-up and lots of people were out of work.

This cycle of boom and bust has happened before, in the late 1980s with AI and Expert Systems. But at least then, alongside the hype and the greed, there was the much nobler aim of making computers more intelligent, and an attempt to manage customers' expectations. Not this time.

Its association with commodity programmers

During the internet boom phase, companies couldn't hire programmers fast enough. Even inexperienced programmers could command high salaries. There was pressure on university computer science departments to dumb down courses (see Claiming back the meaning of computer science), and to introduce or popularize an MSc in Information Technology (a one year conversion course) so that graduates from other departments could acquire plausible qualifications. The result of this is that, rather than only those students who were actually interested in computing, and /motivated/ to study the more difficult modules, computer science courses were flooded with people who were in it for the money.

Naturally, the quality of the average graduate plummeted, and consequently the quality of the average programmer.

Enter Java

Many of Java's technical deficiencies, and some of its good points (e.g. garbage collection) are a deliberate attempt to make the language suitable for even mediocre programmers. These programmers regularly shoot themselves in the foot with C, because of its weak typing, lack of array bounds checking, and explicit pointers. These programmers are scared of weird looking languages like Lisp (because of its parentheses). Java seems about right for them, so it was chosen for them.

Because there are so many of them, Pointy Haired Bosses think it's easy to replace one Java programmer with another. They are Commodity Programmers.

To my mind, the hallmark of the interchangeable component model of software engineers is Java. Without going into too many details, I'll just say that having programmed in Lisp the shortcomings of Java are glaringly obvious, and programming in Java means a life of continual and unremitting pain. So I vowed I would never be a Java programmer, which pretty much shut me out of 90% of all software engineering jobs in the late 90's. -- Erann Gat, from Lisping at JPL

Java sucks people in

Java isn't just for dummies. Some of the smartest people I know have had to program in it. Working systems have had to be rewritten in it. New systems have been developed in it which could have been up and running in a fraction of the time in had they been written instead in Lisp, Smalltalk or Python. But of course, we can't use those languages because we can't find programmers with experience in those languages because they're all busy programming in Java because it's hard to find jobs in Lisp, Smalltalk or Python. Think what these people would have achieved had they not been thus diverted.

Shrinking horizons

It is my hope, now a somewhat forlorn one, that computers will one day approach human intelligence. For that, a language needs the right features on top of which to build intelligence: symbols (not just variables), singly linked lists, ability to treat code as data and vice versa. Java lacks both symbols and the ability to treat code as data (any more than C can). It has classes for Doubly Linked Lists. (Of course, you can always greenspun your own singly linked lists.)

Unlike some languages such as Lisp and Prolog, Java was never designed with the intention of making computers smarter. It was designed to have as wide an appeal as possible, with the intention of taking on Microsoft. But if you dumb down the programmers, the programs that get written get dumbed down, too.

Java would have been an exciting language 30 years ago. Eight years ago, we deserved something better.

Others' opinions

Your head doesn't damage walls. Java damages walls. -- Nathan Myers

But I do not particularly want to go where the money is - it usually does not smell nice there. -- Alexander Stepanov.

Edsger Dijkstra on Java (Trouw, 18 Oct 2000)

Interviewer : There is some progress? There are new programming langugages that make everything easier, even ordinary internet users have heard of Java.

Dijkstra : It's embarrassing. Because it is so bad. The only reason Java has been accepted is because it is a product of a company, SUN, that has made enormous advertisement for it. Beautiful programming languages exist, and a good language, like a tool, is just a joy. But industry doesn't want that. Probably because decisions are made by technically incompetent people.

Steven T. Abell on Java (formerly Java Technology evangelist at Netscape)

I came to Java from a different world of programming, the Smalltalk world. For people who program in Smalltalk, Java is a 30-year step back.

Alan Kay on Java (OOPSLA '97)

Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS-DOS.

Donald Knuth on Java

I get secret satisfaction when bad ideas take hold and suck a lot of people in ... like Java (Just teasing.)

EJB brain damage

The code for "Hello World" using Enterprise Java Beans is here. This was written by people who aren't by any stretch of the imagination anti-Java. By way of comparison, here's the JavaScript:

document.write("Hello World");

Other high level languages are similar one-liners. Even Intercal, a language developed as an elaborate joke, is more succinct: Hello World in Intercal. Of course, Java apologists will point out that EJBs were never intended for anything that simple. Heaven knows how long anything complicated will be in them.

This page was linked to from

and was last updated on 2006-03-11 at 23:17.

© Copyright Donald Fisk 2006