Two straw men walk into the Foo Bar…
“Howdy, pardner. My name’s Java, but my friends call me “The COBOL of the 21st Century”. People know me for bein’ verbose. ‘N fact, it takes 200 lines of code and three XML descriptor files just to say ‘Hello world’.”
“Yo dude, ’sup. I’m a dynamic-slash-scripting language. I’m all about cutting to the chase. You can whip up web apps with me in five minutes. Of course, if you put me in production, I’ll go down faster than a porn star on coke.”
OK, everyone, now that we’ve worked through the outrageous generalizations, we won’t need any such ridiculous exaggerations in the comments… right, guys?
I do find the Java vs. Ruby/Python/etc. sniping interesting not as a technology choice, but as an expression of values, a means of teasing out what matters to developers. This is important because it should totally tell us where Java needs to go in the future, in a more useful (if less direct) way than assembling committees of experts to write JCP specs of sometimes dubious practicality.
So obviously, it was of great interest the other day to see of James Gosling speak of his affinity for scripting languages in his blog entry RADlab, scripting and scale, even going so far as to say:
Over the years I’ve used and created a wide variety of scripting languages, and in general, I’m a big fan of them. When the project that Java came out of first started, I was originally planning to do a scripting language. But a number of forces pushed me away from that.”
What kind of forces? Gosling cites scaling. He describes some curious misuses of various languages (a BASIC compiler done with emacs macros, an Adobe Illustrator clone in PostScript), and concludes “They always ended with ‘this is so cool, but I’d like it to be as fast as {C,Assembler,whatever}’. People get into scripting to quickly build small quick things, but they often grow far beyond where the initial concept started.” Kind of a straw man argument, but we’ll come back to that in a sec.
Representing the sane side of the scripting language argument (i.e., not the idiots who pollute talkbacks with “Java is teh suck” and actually aren’t being ironic) is Bruce Tate and his manifesto Beyond Java. This is easily the most interesting computer book I’ve read this year. It’s not perfect — Bruce Eckel dings him for some weak research, and his understanding of desktop Java is summed up by embarrassing and pithy cheapshots like “friends don’t let friends use Swing” — but the bulk of his argument is strong. Tate says that Java has become less productive than the alternatives for the key tasks most developers use it for: connecting some kind of web interface to a database, possibly with some business logic.
Not to overpersonalize the two sides, but let’s represent these two vital assertions by the speakers: Gosling says scripting languages won’t scale, and Tate says Java has gotten too complicated.
It is critically important to understand and appreciate that Gosling doesn’t have to be wrong for Tate to be right, and vice versa. Indeed, the most interesting case, and the most likely one, is that they’re both right: Java scales better, but it’s more of a pain to write.
That leads directly to an important question: is Java’s complexity worth it? And that may be an issue of context.
After all, these are arguably gray-area assertions: At some point, Java scales significantly better than the scripting languages… but when? For some developers and some projects, Java’s complexity is unduly burdensome… but for whom? There may be projects so small that the scaling question doesn’t figure. There may be projects so complex that the simplicity of the scripting languages are irrelevant.
It would be easy enough to fall back to the usual conclusion that “there’s no one perfect language,” and that would be fine, but there really is more weight to this argument than that. It wouldn’t still be attracting so much attention if it really were entirely subjective, like a preferred style for indenting curly braces, or the perfect font for coding.
So now here’s the context that I spoke of above, and why I think Tate’s arguments really need to drive some change within the Java community: who is the Java programming experience really tailored for? Tate argues that Java is increasingly concerned only with a very high-end, enterprise developer. That worries me because… and this is a hunch and a feeling that I can’t back up with numbers so don’t ask… that there might only be a few hundred developers who genuinely have to deal with a million simultaneous users, while there’s probably at least a million developers who’ll never have to handle more than a hundred simultaneous users.
The more Gosling is right about Java scaling, the better suited it is for the first group. The more Tate is right about Java complexity, the worse suited it is for the latter group. And look which group is larger.
That’s what interests me about Beyond Java. Not that Java is intrinsically wrong, but that it may have become wrong for a lot of the people using it.
Ten years ago, the young Java programmer could ask the C++/CORBA types whether it really made sense for them to have to worry about memory management instead of business logic. Today, the scripting language advocates are asking us why we have to be responsible for so many add-on frameworks and configuration files. It’s not hard to see this as an analogy that Java desperately needs to avoid falling into.
We now return you to your regularly-scheduled language bashing…