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 333393
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[4]: I like C++
by danieldk on Sun 12th Oct 2008 09:35 UTC in reply to "RE[3]: I like C++"
Member since:

You could argue how much of that is actually due to the greatness of the language, as opposed to just the way things are.

Of course, the "status quo" has a large influence, but additionally I think that imperative (and OO) programming correspond more to the way our mind maps problems to code. You can see that difference between, say, a Java course or a Prolog course at a university (BTW I love Prolog, and write Prolog for food at the moment). Java is picked up very easily by nearly everyone, Prolog often takes a few weeks to get, and some people never get it. Rather than subdividing problems in steps (which is our daily manner of solving problems) it requires a programmer to map a problem to a set of predicates that can be used to prove a result (and often also vise versa). Prolog is natural for certain problems, and easier if you are well-schooled in logics. Likewise, many functional languges are natural for certain problems and easier when you are well-schooled in mathematics. But a considerable amount of programmers that churn out Visual Basic or Java code will have trouble using other paradigms, and will not need it most of the time.

For this reason, I think the current trend of mixing some concepts from functional programming with imperative languages is more interesting. Programmers can continue with what maps well with our brains, and use functional programming where it fits very well with specific problems.

However, C was tied to UNIX which was given for free with code to many universities. Then came C++ with many pitfalls, but you could keep all the C code, and people started to drift to that as the preferred OOP language from more pure approaches. Not because it was a superior language, but because it was C with classes.

C++ has developed a lot since the mid-eighties. It's not just C plus classes anymore, and if you restrict yourself to a modern subset (by using STL extensively), it's a nice and comfortable language, with an elegance that leave a lot to desire in other languages (e.g. iterators are painfully limited in most languages and most static languages have no support for generic programming beyond type erasure).

The painful thing is code that was written by programmers who still think C++ is C with some added conveniences. That code is often full of redundant algorithms (that should be replaced by STL algorithms), use of arrays, C-style character strings, global variables, no use of RAII, etc. And that is a disadvantage of C++: it allows people to be stuck somewhere between the old world and the new world, which is bad for developers from both sides.

Reply Parent Score: 6

RE[5]: I like C++
by ebasconp on Sun 12th Oct 2008 22:11 in reply to "RE[4]: I like C++"
ebasconp Member since:

Java is picked up very easily by nearly everyone, Prolog often takes a few weeks to get, and some people never get it.

I agree with you... I never was able to see the light behind Prolog ;)

Reply Parent Score: 2