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

deadalnix deadalnix at gmail.com
Fri Jan 17 17:29:44 PST 2014


On Saturday, 18 January 2014 at 01:05:50 UTC, Walter Bright wrote:
> Because I've tracked down the cause of many, many null 
> pointers, and I've tracked down the cause of many, many other 
> kinds of invalid values in a variable. Null pointers tend to 
> get detected much sooner, hence closer to where they were set.

To be fair, I do think we should require explicit initialization 
for char for instance instead of putting in them an invalid 
codepoint. Still, the consequences for null are much more 
dramatic, which make it more worthwhile to change. They don't 
have the same ROI as they don't have the same cost.


More information about the Digitalmars-d mailing list