|
"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:
- object creation will invoke mallocs and replicated 'inline static' functions -the cost of these abstraction layers can be advantageously avoided;
- virtual inheritance and virtual functions are both so badly engineered that they double the machine code size -and execution time;
- as templates are eventualy encapsulating libraries of encapsulated layers -why not write code targeting clarity, speed or, let's be fool, both?
Conclusion: C++ is as efficient as C only if you do not use the '++'.
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)
"And folks, let's be honest. Sturgeon was an optimist. Way more than 90% of code is crap" (Al viro)
|