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.
In a language like Java where basically every variable is a reference,
it can be a lot more difficult to figure out where a null came from.
I've never had this problem in code I've written either, but I've had to
maintain some Java code that was nearly impenetrable and this was
absolutely an issue.
Sean
- Re: Null references (oh no, not again!) Andrei Alexandrescu
- Re: Null references (oh no, not again!) bearophile
- Re: Null references (oh no, not again!) Denis Koroskin
- Re: Null references (oh no, not again!) Yigal Chripun
- Re: Null references (oh no, not again!) Christopher Wright
- Re: Null references (oh no, not again!) Sean Kelly
- Re: Null references - crash dump on Win The Anh Tran
- Re: Null references (oh no, not again!) Walter Bright
- Re: Null references (oh no, not again!) Andrei Alexandrescu
- Re: Null references (oh no, not again!) Walter Bright
- Re: Null references (oh no, not again!) Sean Kelly
- Re: Null references (oh no, not again!) Walter Bright
- Re: Null references (oh no, not again!) Sean Kelly
- Re: Null references (oh no, not again!) BCS
- Re: Null references (oh no, not again!) Christopher Wright
- Re: Null references (oh no, not again!) Andrei Alexandrescu
- Re: Null references (oh no, not again!) BCS
- Re: Null references (oh no, not again!) Christopher Wright
- Re: Null references (oh no, not again!) BCS
- Re: Null references (oh no, not again!) Christopher Wright
- Re: Null references (oh no, not again!) BCS