Linked by David Adams on Sat 11th Oct 2008 16:48 UTC, submitted by IndigoJo
General Development Eric Raymond is working on an essay, putatively titled "Why C++ Is Not My Favorite Programming Language". In his announcement, he calls it "an overcomplexity generator", "bloated, obfuscated, unwieldy, rigid, and brittle", and alleges that these characteristics appear in C++ applications also. I contend that many of the complaints about C++ are petty or are aimed at specific libraries or poor documentation and that many of the features commonly regarded as unnecessary (and excluded from intended replacements) are, in fact, highly useful. C++: the Ugly Useful Programming Language
Thread beginning with comment 333311
To read all comments associated with this story, please click here.
I hate to agree with ESR...
by sergio on Sat 11th Oct 2008 17:45 UTC
Member since:

But He has a point here. C++ is the "Perl" of compiled languages... it's huge and HORRIBLE... but It's powerful and everybody uses it. It's a fact.

I think they have to take a _small_ subset of the language and create a new one from that (100% compatible at compiler and binary level). Then name it C--, Cava or C* and profit. :-)

Reply Score: 4

GeneralZod Member since:

The entire language itself is certainly huge, but I'd venture that the "working set" that most developers can use to be very productive* is really not so formidable, and that even with this subset of the language, resulting code is often smaller and with less "boilerplate" than the corresponding C. Self-discipline is obviously required, though; C++ gives you yards and yards of rope with which to hang yourself ;)

* The LLVM guys, for instance, use what they call a "tasteful subset" of C++, and I've seen people who simply can't understand why anyone would ever use C++ over C - a viewpoint very nearly diametrically opposed to mine, for the record - praise their approach and codebase.

Reply Parent Score: 8

Vanders Member since:

The entire language itself is certainly huge, but I'd venture that the "working set" that most developers can use to be very productive* is really not so formidable

Agreed. Most of the C++ in Syllable for example doesn't use much more than basic classes, references and exceptions. You could do all of these things with nothing more than standard C, but doing it with C++ makes the code neater and more logical.

Reply Parent Score: 4

google_ninja Member since:

Best perl description I have ever heard was the rather famous blog post by steve yegge entitled "Tour de Babel"

There are "better" languages than Perl — hell, there are lots of them, if you define "better" as "not being insane". Lisp, Smalltalk, Python, gosh, I could probably name 20 or 30 languages that are "better" than Perl, inasmuch as they don't look like that Sperm Whale that exploded in the streets of Taiwan over the summer. Whale guts everywhere, covering cars, motorcycles, pedestrians. That's Perl. It's charming, really.

But Perl has many, many things going for it that, until recently, no other language had, and they compensated for its exo-intestinal qualities. You can make all sorts of useful things out of exploded whale, including perfume. It's quite useful. And so is Perl.

He describes c++ thusly

C++ is the dumbest language on earth, in the very real sense of being the least sentient. It doesn't know about itself. It is not introspective. Neither is C, but C isn't "Object-Oriented", and object orientation is in no small measure about making your programs know about themselves. Objects are actors. So OO languages need to have runtime reflection and typing. C++ doesn't, not really, not that you'd ever use.

As for C: it's so easy to write a C compiler that you can build tools on top of C that act like introspection. C++, on the other hand, is essentially un-parseable, so if you want to write smart tools that can, for example, tell you the signatures of your virtual functions, or refactor your code for you, you're stuck using someone else's toolset, since you sure as heck aren't gonna parse it. And all the toolsets for parsing C++ out there just plain suck.

C++ is dumb, and you can't write smart systems in a dumb language. Languages shape the world. Dumb languages make for dumb worlds.

All of computing is based on abstractions. You build higher-level things on lower-level ones. You don't try to build a city out of molecules. Trying to use too low-level an abstraction gets you into trouble.

We are in trouble.


With that said, it is obviously possible to write nice C++ code, by which I mean, code that's mostly C, with some C++ features mixed in tastefully and minimally. But it almost never happens. C++ is a vast playground, and makes you feel smart when you know all of it, so you're always tempted to use all of it. But that's really, really hard to do well, because it's such a crap language to begin with. In the end, you just make a mess, even if you're good.

I know, this is Heresy, with a capital-'H'. Whatever. I loved C++ in college, because it's all I knew. When I heard that my languages prof, Craig Chambers, absolutely detested C++, I thought: "Why? I like it just fine." And when I heard that the inventor of STL was on record as saying he hated OOP, I thought he was cracked. How could anyone hate OOP, especially the inventor of STL?

Familiarity breeds contempt in most cases, but not with computer languages. You have to become an expert with a better language before you can start to have contempt for the one you're most familiar with.

So if you don't like what I'm saying about about C++, go become an expert at a better language (I recommend Lisp), and then you'll be armed to disagree with me. You won't, though. I'll have tricked you. You won't like C++ anymore, and you might be irked that I tricked you into disliking your ex-favorite language. So maybe you'd better just forget about all this. C++ is great. Really. It's just ducky. Forget what I said about it. It's fine.

I agree with pretty much his entire essay

Reply Parent Score: 5

RE: I hate to agree with ESR...
by evangs on Sun 12th Oct 2008 07:39 in reply to "I hate to agree with ESR..."
evangs Member since:

What would you strip out of C++ and what would you leave in?

Reply Parent Score: 2