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

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


On 1/17/14 11:43 AM, Walter Bright wrote:
> On 1/17/2014 6:06 AM, "Ola Fosheim Grøstad"
> <ola.fosheim.grostad+dlang at gmail.com>" wrote:
>> On Friday, 17 January 2014 at 01:42:38 UTC, Andrei Alexandrescu wrote:
>>> One common idiom to replace null pointer exceptions with milder
>>> reproducible
>>> errors is the null object pattern, i.e. there is
>>
>> Usually null failures are hard to track when some function returned a
>> null value
>> as an indication of error when the programmer expected an exception.
>
> 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.

I think this is bias that is countered by extensive experience of groups 
at Facebook that have no axe to grind in the matter. This bias makes it 
all the more difficult to recognize the importance of the problem.

Andrei



More information about the Digitalmars-d mailing list