Re: The D Programming Language
"James Kanze" <james.kanze@gmail.com> writes:
I'd even go further and say that I prefer the Java
solution of consistently doing the wrong thing to that of C++,
which results in inconsistent and untestable behavior.
I agree that the behavior is often inconsistent. I disagree that it's
untestable in practice. One of my points is that labelling some
behavior undefined can improve testability, because the system can
then things observably outside the realm of defined behavior. It's
true that it's a crapshoot whether the behavior of most running C++
programs will be observably undefined, but that is technically
speaking an implementation artifact, for efficiency. There's no
reason in principle that a C++ system couldn't be written that
immediately detects way, _way_ more of the errors that lead to
undefined behavior and invokes a debugger immediately. Every pointer
dereference could be fully checked, for example.
Undefined behavior is bad,
I don't think that's been demonstrated, and I challenge it as an
axiom.
Whether undefined behavior is badly expressed in today's running C++
programs is another matter.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]