|
Re: In the Spirit of C
|
Posted: Jun 27, 2004 8:40 AM
|
|
(Was it really in Santa Cruz where Erwin demonstrated his compile-time prime filter? I seem to recall King of Prussia, Pennsylvania, or maybe Kitchener, Ontario.)
I found the article far too kind to Java. Had Java come along before C++, many of its design mistakes could be forgiven. Given full hindsight, though, there can be no excuses.
C++ "exception declarations" were recognized early as a mistake, but incorporated into Java nonetheless in even more intrusive form. (In C++ they can be ignored; not so Java.) Real C++ exceptions work well to reduce error-handling clutter, but in Java they actually increase clutter. C++ destructors, combined with template techniques, make it possible to encapsulate management of any kind of resource -- enough so that I have not needed to code a "delete" statement in many years. Java handles memory invisibly, but all other resources must be managed manually, C-style. C++ got the default "virtualness" of member functions right; Java got it wrong, so that Java classes, by default, expose much more of their implementation. Haste is a disastrous ingredient in language design.
The designers of Java, freed from compatibility constraints, had a golden opportunity to correct many of the problems inherent in C, and incorporate the power of C++ while leaving behind much of its complexity. They squandered that opportunity. C# designers had the same opportunity, again, and (given the greater hindsight) did even worse, retaining even many of the failed choices from Java. D did only a little better.
I call them "cargo-cult languages". Their designers copied features from other fashionable languages, but without understanding. They are the language equivalent of those shareware CDs that used to be described as shovelware. They are full of features, tossed into a bag with little thought given to how the features will interact.
A true successor to C++ is dearly needed. We need a language that leaves behind C's promiscuous conversions, its chaotic declaration syntax, its gratuitous undefined behaviors, its ill-thought-out library. We need a language that leaves behind C++'s name-lookup complexity, its awkward compile-time pattern-matching and expression syntax, its unfortunate library history. These other languages are only distractions.
|
|