Java: Slow, ugly and irrelevant

By Simson Garfinkel

Published January 9, 2001 8:30PM (EST)

Read the article

I enjoyed Simson Garfinkel's recent Salon article on Java and I agree with him that Java, like most technology, has failed to live up to much of its early hype and promise, notably the "write once, run anywhere" mantra. Still, I think that Garfinkel gives Java and its designers too little credit for a very important accomplishment, namely, introducing, popularizing and gaining widespread acceptance for a programming language with features that make it extremely valuable in both industry and education.

As anyone who has written a program for a nontrivial task will attest, garbage collection is a feature that saves an incredible amount of development time, resulting in increased productivity and decreased frustration. Garfinkel mentions this fact in his article, but doesn't point out another, equally important feature of Java: its strong type-checking. In plain English, this means that Java prevents you from treating an apple like an orange (or a gas tank like a glove box), a dangerous trick that other programming languages permit or even encourage, as C does. Having programmed for two decades in several different languages and taught computer science to college students, I can assure you that these two features together give beginners a much stronger foundation for thinking about and designing program than they will get from a fast-running but wildly unconstrained language like C/C++.

Yes, other languages have these features, but these languages never had the industry support necessary to gain them widespread usage outside of universities or research labs. Yes, these features can be glommed onto existing languages like C++, as C++ glommed object-orientation onto C, but in Java the features are designed into the language, which makes a huge and obvious difference. And yes, Java is slow for some (often poorly written) applications, but increased processor speed is a given nowadays, whereas good design most certainly is not.

In short, though no "perfect" industrial programming language exists, Java has made tremendous progress toward that goal, dragging the software business into the modern era. Such a contribution is not easily dismissed.

-- Simon Levy

I've programmed in Java for three years. I've done five major projects and many small ones. I also program in assembly, C and C++. I've done work in PostScript. I learned Fortran, Forth, Pascal and a little Smalltalk and Lisp.

I prefer to program in Java.

When PostScript came out, there were lots of complaints similar to those about Java, but it was the best solution for printing devices and has become the basis for a number of imaging technologies. Using PostScript I learned that no language can truly be device-independent, but there are languages which do a much better job of isolating and significantly reducing the number of lines of machine-dependent code. PostScript and Java both do this very well.

If you compare Java with what C is good at -- doing low-level, time-critical, machine-dependent code -- Java loses. If you compare Java with C at what Java does best -- application software with a lot of user interaction -- Java wins. I've written such applications in assembly, C, C++, Java and a proprietary game language at Sierra Online and Java is much easier, more reliable and, yes, often faster.

Your attitude is not uncommon. I often meet or work with programmers who insist on programming in Java as though it were some other language. I recognize the syndrome because I saw it when C, C++ and PostScript became available.

I've been in the software business for 20 years and have had to learn a lot of systems, a lot of languages and a lot of styles of programming. It is almost insulting for you to say that the solution is to train better programmers. You speak as though you have no conception of the breadth of knowledge programmers have always had to have.

I much prefer having a reliable language and module library; 95 to 99 percent of the code I write runs on all machines. C was designed as a first abstraction layer for assembly language. C++ is an overly complex attempt to attach an object model to it. Both have too many implementations and mismatching libraries to ever provide a general programming solution no matter how well trained the programmers.

-- Mark Martino

I've read enough of Simson Garfinkel's other work to have a lot of respect for his opinion. And he is correct that Java is no silver bullet and is very poor at the types of applications he discusses. If these are the types of apps he works on, I'm not surprised he dislikes the language. Still, he completely misses the point about the largest market for Java.

Java is the killer language for large-scale server-side enterprise applications, especially those with Web interfaces. It allows object-oriented techniques like design patterns to be implemented efficiently, and it isn't especially slow, since there is no UI code. In any case, the performance of enterprise applications is usually determined by the efficiency of the database drivers and network communications.

Garfinkel pointed out that distributed garbage collection was one good idea that was incorporated into Java. There's one other major one: standardized libraries. Even if "write once run anywhere" isn't true, moving your server application from NT to Unix is pretty trivial. For a C++ application, you generally have to rewrite any code that uses libraries, which is approximately everything.

-- Andrew Norris

It is a shame that Garfinkel brings up a very important point in an article that does nothing more than try to inflame the programming language "wars."

Garfinkel's point that having well-trained, well-educated programmers is far more important than the choice of language used to program is something that many people in this industry really need to understand. The idea that there are no magic solutions in software is something that many people simply do not understand, especially programmers.

However, this important point gets lost in the language-baiting nature of this article. The points about Java's numerous problems could be made equally about any other language out on the market. The fact is that the choice of programming language involves tradeoffs. If all we were trying for was speed, all programmers would be programming in assembler.

Personally, I use Java and have been using Java since the 1.0 alpha 3 release, and I wouldn't go back to C or C++. I find that the benefits of maintainability, readability and the way in which the language enables me to work on the "important" stuff I'm trying to do far outweigh any performance problems.

Java is not for everyone. No programming language is. It is just a shame that Garfinkel loses a very important point about training and experience in the midst of complaining about a language that does not do everything people have claimed it will -- which of course is not remarkable in any software-related product.

-- Robert Ellman


By Salon Staff

MORE FROM Salon Staff


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