Non-null objects, the Null Object pattern, and T.init

Adam D. Ruppe destructionator at gmail.com
Fri Jan 17 12:04:15 PST 2014


On Friday, 17 January 2014 at 19:43:58 UTC, Walter Bright wrote:
> I've almost never had a problem tracking down the cause of a 
> null pointer. Usually just a few minutes with a debugger and 
> getting a backtrace.

It's not always easy to run a debugger on it. I just had an 
exception (not even a segfault) take two days to track down 
since, 1) the std.variant exception messages SUCK and 2) after 
finding where the exception was coming from, it was still hard to 
find why the input was weird.

A bad value from a third party server (generated with the one 
specific user's request) got stored and used a bit later.

The problem wasn't where it was used: it was where it came from. 
And that's what the NotNull seeks to help.


More information about the Digitalmars-d mailing list