Null references (oh no, not again!)

Nick Sabalausky a at a.a
Wed Mar 4 00:51:46 PST 2009


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:gole1d$23v4$1 at digitalmars.com...
> Rainer Deyke wrote:
>> Writing an assertion for every non-nullable reference argument for every
>> function is tedious.
>
> It's also quite unnecessary. The hardware will do it for you, and the 
> debugger will tell you where it is.
>

Yes...at run-time. And even then only if you're lucky enough to hit all of 
the code paths that lead to a null-reference during testing. It might not 
cause data-corruption, but it does cause a crash. A crash might not 
typically be as bad as data-corruption, but both are still unnaceptable in 
professional software. Plus, a crash *can* be nearly as bad, if not equally 
bad, as data-corruption when it occurs in something mission-critical. This 
is not a problem to be taken lightly. 





More information about the Digitalmars-d mailing list