Monday, March 28, 2011

Don't diss Java - Be Happy

On the occasion of Gosling joining Google, it's Java diss time again. But most Java criticism doesn't take its raison d'ĂȘtre into account:
We were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp. Aren't you happy? — Guy Steele
Java has many faults. But most of them are there by design. That's not something many language designers can claim.

Java was a Trojan Horse, designed to slip in a modicum of dynamic features without C++'ers getting suspicious.

That whole dynamic-language-in-the-mainstream thing may have never happened without Java.

Aren't you happy?


aaronla said...

Ahhh, true enough. Though, it seems the trojan horse has itself become the new fortress.

The other unfortunate element is that C++ has matured beyond the state it was at when Java aimed to overthrow it. Back in 1995, exception handling was still brand new, templates relatively untested, and most developers were using it as a slightly better C.

Now, templates have brought generic/parametric programming to the masses (with pretty good perf to boot). Java has type erasure, C++ has terrible compiler error spews -- about breaking even in my book.

Now we long for something to improve upon backwards quirks of those ancient languages, C++ and Java.


patrickdlogan said...

I blame C++ for being bad more than I praise Java for being better.

Also hardware and compiler technology at the time Java came out made dynamic language popularity inevitable. I disagree Java was necessary for that.

Smalltalk was already becoming popular in IT before Java. The only remaining problem was the expense of proprietary Smalltalk implementations. That would have been addressed sooner rather than later too.

Arguably Java set us back a decade or two.