Re: C++ Frequently Questioned Answers
Alex Shulgin wrote:
From your words I can guess that you have had pretty weird experience
with C++ on a large project... and somehow you have expected much of
the "features" the language have never declared to have: garbage
collection, built-in run-time checks, reflection, etc; Features one
would normally expect from a _very_ high level language like Python,
Ruby, Lisp, etc; but not C++.
It is not necessary to have a very high level language to have these
features (after all, Pascal had runtime checks decades ago). C++ does
have some compile time reflection (sizeof, offsetof, and the various
traits templates), and some runtime reflection (dynamic_cast, rtti).
So basically, instead of blaming yourself (or whoever is responsible)
for poor language/task choice you try to blame C++... Duh!
While it's pretty obvious that Standard C++ doesn't have gc, many of the
issues with C++ don't become apparent until you're fairly skilled with
it. The lack of transitive const comes to mind.
"No binary implementation rules"
Frankly, I don't see your point here. You have tried to link g++-
compiled libraries with msvc-compiled code, or what exactly?
I think he means ABI, Application Binary Interface. While a lack of this
allows C++ compiler vendors to innovate with it (and they have done so),
the downside is that objects compiled with one compiler cannot be linked
with objects compiled with another compiler.
"Defective exceptions"
... Exception safe C++ code is almost infeasible to achieve in a non-trivial program.
Maybe, if you prefer to write everything from scratch instead of
trying to stick to standard library. Personally, I have never had
that kind of problem.
Exception safety isn't hard to achieve with RAII techniques if the
things that must be unwound are independent, or nested. Achieving
exception safety where A, B, C, and D must either all happen or none
happen is much more difficult.
For more information:
http://www.digitalmars.com/d/exception-safe.html
http://www.ddj.com/cpp/184403758
"Item 29: Strive for exception-safe code" in Effective C++ Third
Edition, pg. 127 by Scott Meyers
-----
Walter Bright
http://www.digitalmars.com
Digital Mars C, C++, D programming language compilers
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]