Re: The D Programming Language
David Abrahams wrote:
"Andrei Alexandrescu (See Website For Email)"
That said, even in a system with no undefined behavior, we have no
idea what the value of x (or anything else in our program) is after a
programming error, so the ability to continue on with the program
executing the instructions you thought you were giving it originally
is not as valuable as it might at first seem.
It's not "anything else in our program". It's "anything else in our
program that was affected by x"
No, not at all. Re-read the scenario; "x" didn't necessarily have
anything to do with the programming error. From a practical point of
view, by the time your internal checks/assertions have detected that
there's been a programming error by inspecting some piece of program
state (call it Z), you have no idea how far the damage has spread.
That is, the program's own guarantees are out the window.
I disagree. As I explained before: in Java bugs can be made modular in
ways that are not possible in C++, because you have true memory
isolation between objects.
and because (say in Java) races only happen on numbers
Meaning that in Java, all writes of "references" (a.k.a. pointers) are
synchronized?
That is correct. They are guaranteed to be atomic; there is no invalid
reference in Java, ever, period.
and because there's no pointer forging, that reduces to "any other
number that was affected by x", which considerably reduces the rot
in the program and the difficulty in spotting it. I guess all I can
say is that I tend to see that guarantee as much more valuable. :o)
Than what?
Than "all the hell breaks loose starting at this point".
Andrei
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]