Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why is C++...

Name: Anonymous 2011-12-07 12:06

...so bad? Why does it have such a bad reputation?

I'm an experienced C++ programmer and, while the language has warts, I can't understand the reason for the enormous amount of criticism against the language.

I'd like to hear the honest opinions of /prog/rammers in this regard.

Name: Anonymous 2011-12-08 15:58

>>68
the thing is, C++ basically invented modern, typical OOP. Java and C# in particular base their models directly on C++. Languages like Smalltalk and CLOS were perhaps in the background, but, funny enough, these languages are both all about duck-typing and extensible, future-proof design as a consideration above and beyond performance.

In a general comparison of CL and C++ you see a reoccurring pattern. It isn't that C++ made a different, arbitrary choice of problem/solution pairs. It's that C++ ALWAYS chooses the option that corresponds to premature optimization. And CL isn't even the best example, just a convenient reference point.

Multimethods: flexible and generic.
vtables: optimized

lambda: flexible and generic
classes: optimized

garbage collection: flexible and generic
the stack, shared_pointer, etc: optimized

numerical tower: flexible and generic
int,float,double, iirc STL has not standardized a bignum class yet: optimized

macros, essentially a "scriptable compiler": flexible and generic
leave the compiler alone so it can micro-optimize better: optimized

So, if C++ made any arbitrary choice of problem to tackle, it was to design a language that is easy for compilers (human or non, to borrow a Paul Graham-ism) to optimize, not to make it easier for programmers to write better software. This isn't in and of itself a problem. It's what C does. The difference is that C is honest about what it is and what it's for. It's a language for implementing a solved problem in an efficient and portable way. C++ OTOH has a pretense that it's not just fancy assembly.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List