Andrei Alexandrescu wrote:
Walter Bright wrote:
Daniel Keep wrote:
I need to know when that null gets stored, not when my code trips over
it and explodes later down the line.
Ok, I see the difference, but I've rarely had any trouble finding out
where the assignment happened. In fact, I can't remember ever having a
problem finding that.
That's because the null pointer exception is nearly always repeatable,
so it isn't hard to work backwards. The non-repeatable ones have been
due to memory corruption, which is a different issue entirely.
The world is more diverse than one environment. When I run 200 jobs on a
cluster, failure from null pointer usage comes back with no file and
line information, no debugger nicely starting, no nothing. And it's not
easy to reproduce that on a small machine with GUI and all.
At least Linux might produce a core dump that can be used to re-start
the process. Windows users are pretty much out of luck. That said, I
agree with you completely.
Sean