Java fans fight back

OK, Sun's programming language does have some good points, but it's still a long way from perfect.

Published January 18, 2001 7:23PM (EST)

My article last week on Java touched a nerve with readers. After reading the column, more than 100 people clicked the "mailto" link on my byline and let me know precisely how they felt -- and hundreds more wrote angry letters to the editor. I tried to respond to the first 50 or so e-mails. But when the mail kept pouring in after a week, I asked my editor if I could write a response for all to read.

Reactions to the article were mixed, with roughly 40 percent agreeing with my conclusion and 55 percent calling me names, cursing at me with their keyboards and saying that I don't know beans about programming. The remaining 5 percent were the most curious of all -- they said that I pulled my punches, that I wasn't harsh enough on the Java blight.

It's easy to understand how the article could engender such varied responses. Java is a huge industry. There are tens of thousands of companies using Java and hundreds providing tools for the language. And since there is so much disparity between the programmers that are bad at Java and those who are good at it, an attack on Java as a whole can be very threatening to those at the top of the profession. Or as one programmer with a Hotmail account told me, "Here's this for a kicker: I make more than YOU and I'm cutting code in Java! :) Suck on my $200,000/yr as a Java Developer, dumb ass."

Considering the more literate responses, the biggest criticism was that my analysis of Java was dated. "Your article is clear, concise, accurate and two years out of date," wrote Richard Katz from Mpath Interactive. Like several other readers, Katz told me that the mainstream Java world has given up on Java-based applications -- the real action is with Java application servers.

"You also ignore that the biggest growth market for Java isn't embedded devices and the J2ME," wrote Stu Charlton, a senior consultant at Infusion Development Corp. "It's the enterprise, and the J2EE. (Enterprise consulting is, in fact, my profession.) The number of financial systems that push billions of dollars in transactions through Java is astounding, based on my experience of working at investment banks in Canada, the U.S. and Japan over the last three years."

Others wrote that Java had made their lives easier by allowing them to develop Java plug-ins for Web servers on low-cost Windows NT systems, and then move the same code to $250,000 Sun Solaris servers.

In my defense, I chose to focus on desktop applications and applets because that is where most readers will encounter Java. Sun promised that Java would be the language of choice for developing desktop applications, and Sun has never repudiated this claim. It's also instructive to look at the desktop Java experience because that is where we have the most data, and that is where it is easiest to draw conclusions.

The fact is, it's somewhat easier to understand Java's contribution -- and its costs -- when you consider server-based systems. On these systems, Java's automatic memory management makes it a lot easier to write a reliable application server. And the plug-in nature of the Java class files makes it easier to write with systems like BEA WebLogic. But this ease comes at a price. I've heard of many Java installations where the server steadily uses up more memory as the day goes on, and as a result the servers need to be rebooted every night. There are other ways that performance can suffer. Some readers wrote to me that they have Java running just as fast as C; others wrote that they saw 10-fold increases in server performance when they swapped out an application written in Java for one written in C.

Readers also took me to task for my criticisms of Java portability. In the world of servers, you really can take a Java class file that was developed on a Windows NT server and move it to a Solaris box. "We develop on NT boxes or Unix boxes, and deploy on both," wrote Geraint Preston from Lehman Brothers. "We've never had any problem with platform-independence, which means we can move our applications, with no recompilation, from $30,000 NT application servers to $2 million Sun E10000 servers, as and when we need."

But think about the logic behind this argument for a moment. This argument says that it is more cost-efficient for an organization to spend $2 million on an application server and use Java than to spend $1 million on a lower-priced server and use C++ instead. It's true, many organizations find it easier to throw hardware at a problem than to go out and hire another programmer. But it's also easy to understand why Sun has worked so hard at instilling this attitude in the marketplace: Sun makes money selling big iron.

Indeed, take a closer look at the Java application server market, and you'll see that there's a contradiction of sorts. At first it seems that BEA Systems' Tuxedo 6.x allows you to run Java plug-ins on a huge number of platforms: The company's chart of supported operating systems includes Apple's MacOS, Data General's DG/UX, IBM's AIX, and of course Microsoft Windows and Linux. But look deeper. Although the client runs on many of these servers, the server runs on considerably fewer. Java's famed portability is there for some developers, but not for others.

Many readers took me to task for saying that Java is always interpreted -- there are many just-in-time (JIT) compilers out there now. But even ignoring the fact that the bytecode still needs to be compiled every single time that it is run, and ignoring the problem that there are fundamental difficulties in getting a JIT to compile as efficiently as a traditional compiler, there are still major problems with the Java language definition that condemn it to running slower than C++ forever.

Leo Kuznetsov of Alameda, Calif., sent me an interesting example of the inherent inefficiencies of Java. Consider the case, he wrote, of appending the letters "abc" to the end of a string. In C++ concatenation is pretty simple -- a buffer gets reallocated and three characters get appended to the end of the string. But in Java, three StringBuffer objects and one new String object need to be created.

David Griffiths wrote to me, "Speed is not always the issue. Time to market frequently has a bigger payoff." This is absolutely true, and it explains the popularity of Perl, for those who want platform independence, and Microsoft's ASP and VB Script, for those who don't care about portability.

In that vein, several readers accused me of carrying water for Microsoft -- one even insulted me by asking how much money Microsoft had paid me to place the article. These comments all demonstrate that one of the significant forces behind Java is anti-Microsoft obsession. These people hate Microsoft, and Java is the best weapon against Microsoft, so Java must be good, right? It's a twisted logic, especially when you consider that Microsoft's Java implementations have traditionally been better than Sun's.

The fact is, I do plenty of cross-platform development with C++ and Qt, an application framework that's quite efficient and easy to use. I use Qt because I don't want the code I write to be trapped on Windows or on Unix. Likewise, I use C++ because I don't want my code being trapped in a slow, inefficient and difficult-to-read language.

"Sir, you have hit the nail on the head with your article regarding Java performance in Salon," wrote Brad Clawsie. "Unfortunately, the Java backers are legion. I suspect that you will get an unbearable number of flames. Java supporters are in the denial stage and they are getting a bit prickly with high-profile criticism of the language."

It's sad, but true. Just because Java has created an industry, just because some people are being paid more than $250,000 a year for writing Java programs, that doesn't mean that Java is a good thing.


By Simson Garfinkel

"Simson Garfinkel is a frequent contributor to Salon, the Chief Technology Officer of Sandstorm Enterprises, and the Chief Scientist of Broadband2Wireless, Inc."

MORE FROM Simson Garfinkel


Related Topics ------------------------------------------