Java: hyping yourself in the foot
Java: Hyping yourself in the foot
By Bruce Eckel
Premature and exaggerated praise of Java has distracted us from its
gradual progress.
Many of you will remember numerous computer magazines, over numerous years, announcing "the year of the LAN." After one or two "years of the
LAN," I actually tried to get a LAN working and found it was far too
difficult. I waited one or two more "years of the LAN." Still no
good. I finally gave up. Then one day, hardware was ridiculously cheap, software knew about the hardware, and you could actually plug a couple of machines together and they'd talk to each other. The real year of the LAN had quietly happened.
I think we're on the verge of the same sort of thing with Java.
People used to joke that C++ was a "strongly-hyped" language (a play on "strongly-typed").
We laughed at those individuals or vendors who were overly enthusiastic about what the language could accomplish. Those of us on the C++ Standards Committee tended to think of
it as a pure thing rather than a product; it seemed strange to see hype about a programming language. With
Java this anomaly became commonplace.
I'm not sure if the hype machine at Sun has died down, or if they've simply become more tactful. Although I certainly appreciate the
hushing of the cacophony, I suspect the latter. A big issue has always been performance -- the Sun marketing people
seem to have drilled everyone who might come into contact with the public to
repeat "Java's fast enough right now." And later, "Java's as fast as C++."
The defensive tone clearly impugned your abilities if the programs you wrote
didn't have equivalent performance in both languages. These pronouncements made
me hesitant to admit that my Java programs didn't seem to run as fast as my C++ programs. (I wouldn't want to ruin the chances of my nephews and nieces getting into
college.)
Lately, I've been more interested in the most practical of issues: the failure
of most programming projects. Estimates of failures range from 50% to as high as 80% or 90%, but understandably people tend
not to advertise their failures. Again and again, I hear experienced C++ programmers say that the first Java project that their team tried was up and running in roughly half the time it would have taken them to do it in C++.
To me, this is the great benefit of Java; enforced exceptions and garbage
collection alone produce a huge leap forward in productivity.
Just consider the case of pokey old Visual Basic. For years, legions of programmers
relied upon it; they obviously needed productivity rather than performance. ( I
wonder how much effect Java had
on getting Microsoft to finally produce a VB compiler.)
Java provides much help to programmers. It not only gets projects (even very
large ones) working, but it guides us via language constructs to create programs
that are more maintainable. That's why I find Sun's marketing exaggerations
unfortunate. Claiming that absolutely everything was wonderful when it
wasn't has hurt the company's credibility. The aforementioned performance problem is just one data point. We also had to learn on our own that the AWT wasn't wonderful when they said it was. The IO library is an ever-expanding, messy design that affects many other libraries. The original collections library was poorly designed and implemented, and though we now have a new and much better one, many libraries still use the old versions of the collections (you can't un-publish an interface). And remember the dramatic release of
HotSpot? People in my seminars were shrugging, looking around,
and saying, "Well, I guess it seems a little faster." After seeing enough of this, we've lost faith in any claims made by Sun.
This is too bad, because if you take a fresh look at Java 2, and in particular the JDK 1.3 beta, it's really starting to look pretty good. For one thing, because they've integrated at least some of the
HotSpot technologies and have been working on speeding up Swing,
they've improved the startup performance. The flashing and flickering seems to be on the wane
(I haven't been able to get a JDK 1.3 Swing applet to run in a browser, but non-Swing applets work). And of course, Swing itself
deserves praise. After years of blaming myself because GUI development libraries never seemed to make
sense to me, I'm relieved to say that Swing is the best thing I've seen. I can intuit how to use it rather than
doing research just to get a slider to work (MFC was the worst design I've experienced,
and of course the NextStep creators deserve credit for the roots of the Swing design). Although the new collections library isn't as comprehensive as the C++ STL, I'm a big fan. And the fact that the various APIs can proliferate so quickly is a tribute to the design of Java.
It seems that the language has come into its own. If Corel were to decide to build their office suite in Java now, they'd have a fighting chance;
at last we're seeing real products that are built in Java. Sun ought to have
saved its self-congratulations, because now they are truly warranted.
Maybe the year of Java has arrived (and no, Sun marketing people, you cannot quote me).
To subscribe to Bruce's free newsletter, send
e-mail to: join-eckel-oo-programming@earth.lyris.net.
|