Java, the evolutionary dead-end

April 22, 2003 8:22 AM

In a previous post, I noted Paul Graham had described Java as an “evolutionary dead-end”. After a lot of thinking about what this means, I've come to the conclusion that it's not really such a bad thing for Java to be. After all, the crocodile is an evolutionary dead-end too, but we don't hold that against it.

Firstly, I must point out that Graham takes pains to state that he is not being directly critical of Java in calling it a dead-end, he is just noting that in one hundred years time we will consider it the end of a branch on the evolutionary tree, rather than a step towards something better. It is partly this sentiment that I take into the essay: that being a branch is not necessarily a bad thing.

Graham's first uses the “evolutionary dead-end” label on COBOL: knowing, of course, that he will get no argument from his audience that COBOL is primitive. In his words, COBOL is Neanderthal1. But we should also remember that there is another evolutionary dead-end related to the Neanderthal, a species we call Homo Sapiens. While one dead-end died out, the other managed to survive another 30,000 years and eventually take over the planet.

So what does it mean to be an evolutionary dead-end? It means, simply, to have evolved to the point at which further evolution is unnecessary. For some species, like the crocodile, this means to be so well adapted to your environment that so long as the environment remains intact, there is no need to change. Unfortunately, such a dead-end is also so well-suited to its environment that if that environment is destroyed, the species quickly becomes extinct. For other species, like Homo Sapiens, this means to have evolved to the point that you remake the environment in your own image, and thus no longer need to adapt.

If Java is an evolutionary dead-end, it is because it has taken a particular path as far as it can be taken in that direction. Any language that descends from Java will look so much like it as to be considered part of the same species, like a new breed of cat. (c.f. C#) None of the attributes that make up Java are unique, so languages that adopt them and branch in new directions will quite correctly mark their parentage from somewhere behind Java in the evolutionary tree of languages.

So what are these features that, combined, make up the path that Java has taken to evolutionary redundancy? Let's start with the good ones:

  • Smalltalk-like single-rooted object model and pervasive use of objects.
  • Strong, static typing. Dynamically typed languages seem to be winning the mind-share battle, but I've put this under the good list, because it makes Java more suitable for the niche it has found.
  • Byte-code compiled, run on a virtual machine. Java was certainly not the first to do this, but it took the concept and made it work on the consumer PC (well, at least after the VM matured and the hardware caught up with its requirements).
  • Integrated security-model to allow distinction between trusted and un-trusted code.
  • Large, standard library, with many non-essential features considered part of the language, rather than optional add-ons. (an inheritance from the scripting languages, which all do the same thing)

Java's path also includes a number of compromises. These compromises shape the language just as much as its positive features. If you do not understand why it is necessary to make compromises in design if you want to become widely used, I refer you to the classic paper, The Rise Of “Worse is Better”.

  • C-like syntax. It's not particularly well-suited to the object-centric view of the world, but it sure is familiar to anyone wanting to learn the language.
  • Primitive types. Rather than go the “everything is an object” route, Java compromised and allowed a primitives in. This can be confusing, and requires sundry hacks (object wrappers, or auto-boxing in C#) to overcome, but it is a clasic “Worse is Better” sacrifice of simplicity of interface in favour of simplicity of implementation.
  • The lack of real closures makes the language feel a little brain-dead.
  • The class library is patchy and inconsistent, especially in the classes that were written early-on, before the naming and structural conventions of the standard library were, well, standard.

The thing to remember about “Worse is Better” is that the essay was written as a tactical paper on how Lisp (both the language and the Lisp machine) was over-shadowed by Unix and C. And in 2003, much to Paul Graham's disappointment I am sure, Unix and C are still dominant. Worse-is-better works. If Java had taken the additional performance hit of closures and not having primitives (on top of the initial performance woes that almost killed it), or if it had broken backwards compatibility to fix the standard library, it might not have been adopted the way it has.

And anyway, while Java's particular combination of features and compromises may, in Graham's eyes, make it an unlikely starting-point for the next wave of language evolution, I can see evolution going on in front of me as we speak, with Java as the platform of choice from which to launch it.

1 In the original version of this essay, I claimed the Neanderthal was an ancestor of Homo Sapiens, something that has actually been proven unlikely.

7 Comments

You might want to google for "Neanderthal evolutionary dead end", there's a fair bit of evidence that we're not descended from them (which would mean our true ancestors killed them all, of course).

Damn, last time I looked (quite a while ago, admittedly), they were part of the human family tree. Luckily, the joy of electronic publishing is that I can fix the essay and nobody else will be any the wiser!

This is probably sidetracking a little, but it seems to me that you're assuming species evolve for a specific purpose -- they keep evolving until they get to the state of no-more-evolution-necessary (and thus an evolutionary dead-end). Others may call this evolving to the state of perfection, but I won't assume you're saying that.

The point is, evolution is entirely random. Species don't change on their path to a better format, things randomly change due to genetic mutation and inter-breeding (amongst other things I guess), and sometimes the result is more successful.

Five sixths of all the biological mass on the planet is bacteria, the least-evolved species of them all. Bacteria is widely accepted as being the root of the evolutionary tree, so if evolution occurred as a path to something better, then bacteria wouldn't still be with us after all these years, and certainly wouldn't be the most abundant species on Earth.

I recommend reading Stephen Jay Gould's "Full House" (the British title is "Life's Grandeur") for a much better explanation than I could ever provide. The concept of evolution as understood by biologists has changed so much that it doesn't really work as an analogy for programming languages any more.

Gould is good, but an even better book might be "The Selfish Gene". Evolution is about what propagates genes.

Back on topic, though, I think the problem with Java being an evolutionary dead end is that it implies there isn't anywhere we can go with Java -- that 10 years from now, it's not really going to be much better than it is today.

I'm not sure Graham is correct, however. I'd like to see a more focused essay on the weaknesses of Java.

I was thinking about the referred essay the last days. I found that, in an analogy with human languages, syntax should *not* evolve much once it is reasonable, but lexicon does a lot. I mean libraries.

So, while I think java is close to syntactically right (it has close to first level program objects, some missing pieces like continuations...), it is the lexicon, i.e. the libraries, which will evolve heavily.

Note that I clasify Java as a "system" language, with C. I think I heard this first from Stefano Mazzocchi. It was developed for writing the OS of embedded appliances, after all.

It is similar to English or Spanish. Shakespeare, revived, would mostly understand our English, but would keep asking: what do you mean by "fridge"? you mean *this* is a car?

I think it's a stretch to say that Graham isn't being directly critical of Java, that just wasn't his main point. He's been critical enough of Java in the past (Adam, see http://www.paulgraham.com/javacover.html for some of Paul's criticisms) and I doubt his opinion's changed for the better. Also, I'd be leery of using "Worse is Better" considering the author doesn't seem particularly committed to his opinion (http://www.dreamsongs.com/WorseIsBetter.html). As far as Santiago's comment, I think it was Donald Knuth who said that "C is a language for writing Unix". That's basically Graham's entire argument: as long as you're using a language that requires you to think about low level stuff or go through gyrations to develop higher-level abstractions, you'll be limited in the abstractions that you'll be able to write.

In a biological analogy, Java/C++/C#/etc... are not species. They are, in fact, competing coding schemes for species. The proper analogy would be to DNA/RNA, rather than humans and Neanderthals. A stable language could be considered an evolutionary dead-end, but so could DNA. This strong stability, however, allows new and more complex patterns (bacteria, dinosaurs, Bill Gates) to evolve on top. This is the position I see Java. The "species" are the code that is evolving in the marketplace. And, from that standpoint, the evolution of Java-based "species" is running at full throttle.

Comments are no longer being accepted for this blog entry. If you really want to make your voice heard, you can always email me.

Previously: Easter Parade

Next: Cat-Strangling