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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jan 17 16:17:01 PST 2014


On 1/17/14 3:37 PM, Walter Bright wrote:
> Come on. Every type in D has a default initializer. There's still
> nothing special about null.

There is. Null pointers cause the process to finish.

> Even if you got rid of all the nulls and instead use the null object
> pattern, you're not going to find it any easier to track it down, and
> you're in even worse shape because now it can fail and you may not even
> detect the failure, or may discover the error much, much further from
> the source of the bug.

How do you know all that?


Andrei



More information about the Digitalmars-d mailing list