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 333350
To view parent comment, click here.
To read all comments associated with this story, please click here.
aesiamun
Member since:
2005-06-29

The original request was to get something that you could do everything possible with C++ and still be C compatible.

I delivered ;)

Reply Parent Score: 1

luzr Member since:
2005-11-20

OK, but that applies to about any language ;)

Anyway, if there is any feature that is really *unique* to C++, it is destructor.

It is extremely useful and not present in any other language (AFAIK).

I guess destructors are the real reason why I prefer C++ ;)

Particulary, there is nothing similar in Objective-C.

Edited 2008-10-11 23:24 UTC

Reply Parent Score: 1

aesiamun Member since:
2005-06-29

OK, but that applies to about any language ;)


C compatible? Since when can I take my c code and just run it through the perl interpreter? Python interpreter? Java compiler?

I can do that with my objective-c compiler.

Anyway, if there is any feature that is really *unique* to C++, it is destructor.


You're right there. I don't rely on that often at all, though.

Edited 2008-10-11 23:34 UTC

Reply Parent Score: 3

danieldk Member since:
2005-11-18

The original request was to get something that you could do everything possible with C++ and still be C compatible.

I delivered ;)


Absolutely not. One of the core foundation of modern C++ programming is generic programming. And in C++ this is not implemented through type erasure, instantiation of templates actually lead to new types. Combined with specialization, this also offers metaprogramming, which can be used for doing everything from compile-time optimizations to creating domain-specific languages (e.g. see Boost Spirit).

The Standard Template Library (STL) is built on C++ templates. It provides generic containers and algorithms. Where many other languages add e.g. sort algorithms to list classes (which is not really a reusable approach), STL provides generic algorithms for every container that provides iterators.

So, two of the most important aspects of modern C++, templates and STL are missing in Objective. So, it's not really a substitute. The only thing that probably comes close is D.

Reply Parent Score: 4

luzr Member since:
2005-11-20


Where many other languages add e.g. sort algorithms to list classes (which is not really a reusable approach), STL provides generic algorithms for every container that provides iterators.


To be fair, you CANNOT use std::sort for every container that provides iterators - only for those that provide *random access* iterators.

In fact, I believe that the whole idea of 'generic' algorithms that apply to anything is somewhat moot - the only useful algorithms are those dealing with random access containers. And within those, only sorts and bounds are really important (about 5 total).

In fact, if you would just glue those as std::vector, std::deque methods, you would lose only a little...

While I really like C++, I am not huge believer into STL. IMO, Stepanov nearly killed the language...

Reply Parent Score: 2

tyrione Member since:
2005-11-21

STL and Templates are intentionally not part of Objective-C. That Dynamic Type/linking run-time is still missing from C++.

Reply Parent Score: 2