Escape analysis

dsimcha dsimcha at yahoo.com
Tue Oct 28 07:51:01 PDT 2008


== Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s
> Well I think you were right. The question is how much you spend learning
> things that are actually useful, versus learning gratuitous complexity.
> I think D is much more rewarding per unit of effort invested than C++.
> Andrei

Seconded.  Both C++ and D are very complex languages, but I don't see that as a
problem.  As Bjarne <insert correct spelling of his last name here> would say,
"Complexity has to go somewhere."  If you oversimplify the core language, you end
up acting has a human compiler to make your code fit within the confines of the
simple language.  See Java and C.

The real problem with C++ is not complexity per se, but cruft, the fact that it's
a low-level language masquerading as a high-level language, and the complete
ignorance of convenience as a design goal.

This can be exemplified just by examining how arrays "work" in C++.  First, you
have the cruft of C arrays that are very low-level and really aren't good for
much, except making things more confusing.  To get around this without doing
anything to the core language, C++ adds vector to the STL.  This is fine, except
that you have no vector literals, no slice syntax, horrible error messages,
inefficient copying semantics by default, vectors can't be used in
metaprogramming, etc.  It works, but it's not very convenient.  Furthermore, the
reason you have no nice slice syntax or default reference semantics is because you
have no garbage collection.



More information about the Digitalmars-d mailing list