Feedback

"C++ is a better C" but...

Within C++, there is a much smaller and cleaner language struggling to get out. Bjarne Stroustrup

Why G-WAN does not rely on 'modern' C++

C++'s father Bjarne Stroustrup claims that "C++ code is not larger than C" and that "C++ is a better C" (hence, probably, the '++').

Bjarne also said that the C++ Boost library is "well-engineered" while it is all but efficient on size, on speed nor (and this is even more shameful for a 'better' language) on code clarity.

Would C had made it 'better-engineered'? C does not let 'a+b' weight 10 MB. And if you remove the '++', you still get C – a bit more than just a 'low-level hack'.

Are abstractions really adequate when it's time for efficient real-life action?
As abstractions cannot fit all the situations, they create artificial constraints.
The time spent fighting complexity can be used to achieve higher efficiency.

The problem is precisely that abstraction is achieved at the expense of how computers work (hence the fat it drags). And the heavy '++' is hiding its sins:

  • objects invoke mallocs and replicated 'inline static' functions – which cost can be advantageously avoided;
  • virtual inheritance and virtual functions double the machine code size – and the execution time;
  • templates are encapsulating encapsulated layers – why not write code targeting clarity, speed or both?

Conclusion: C++ is as efficient as C only if you do not use the '++'. What a progress, really.

Others have been more sanguine in their views:

"C++ is an insult to the human brain"  – Niklaus Wirth

"I invented the term Object-Oriented, and I can tell you I did not have C++ in mind"  – Alan Kay

"There are only two things wrong with C++: The initial concept and the implementation"  – Bertrand Meyer

"C++: an octopus made by nailing extra legs onto a dog"  – Eric S. Raymond

"Whenever the C++ language designers had two competing ideas as to how they should solve some problem, they said, 'OK, we'll do them both'. So the language is too baroque for my taste"  – Donald E Knuth

"[C++] certainly has its good points. But by and large I think it’s a bad language. It does a lot of things half well and it’s just a garbage heap of ideas that are mutually exclusive. Everybody I know, whether it’s personal or corporate, selects a subset and these subsets are different. So it’s not a good language to transport an algorithm – to say, “I wrote it; here, take it.” It’s way too big, way too complex."  – Ken Thompson

"And folks, let's be honest. Sturgeon was an optimist. Way more than 90% of code is crap"  – Al viro