Null references redux

bearophile bearophileHUGS at lycos.com
Sun Sep 27 07:00:04 PDT 2009


Andrei Alexandrescu:

> One good thing about nullable references 
> is that they are dynamically checked for validity at virtually zero 
> cost. Non-nullable references, therefore, would not add value in that 
> respect, but would add value by reducing the cases when programmers 
> forgot to initialize references properly.

nonnullable references can also reduce the total amount of code a little, because you don't need to write the null tests often (the points where you use objects are more than the points where you instantiate them).

Bye,
bearophile



More information about the Digitalmars-d mailing list