On 22 May 2020 11:40 -0700, from gnu(a)toad.com (John Gilmore):
Whereas in C++, Pascal, Python, APL, etc, a few
characters can cause the
generated code to do immense amounts of unexpected work. Think of
string compares, hash table types, object initializers, or arbitrary
amounts of jumping through tables of pointers to different kinds of
objects. Automated memory allocation. Garbage collection.
What you wrote is pretty much my take on the subject as well.
However, part of me wants to say "let's not compare apples to
airplanes just because both start with 'a' and one can typically be
placed within the other".
C++ adds a ton of features on top of C, never mind early C, though for
the features that at least earlier C has (I'm honestly not sure about
the newer additions), C++ has very similar or downright identical
syntax compared to C.
As long as you stay with the basic C feature set, I strongly suspect
that most programmers who can follow along in the C to assembler to
machine code compilation process, can do much the same thing with C++.
It's when you start piling all the extras on top of it that things get
hairy from a code generation perspective.
Vectors? Function overloading? Exceptions? RAII? Try predicting the
execution order of destructors during exception handling for classes
with multiple inheritance where multiple inherited-from classes define
destructors. Anything else? :-)
--
Michael Kjörling •
https://michael.kjorling.se • michael(a)kjorling.se
“Remember when, on the Internet, nobody cared that you were a dog?”