Null references redux

Jason House jason.james.house at gmail.com
Sat Sep 26 16:26:03 PDT 2009


Walter Bright Wrote:

> Denis Koroskin wrote:
>  > On Sat, 26 Sep 2009 22:30:58 +0400, Walter Bright
>  > <newshound1 at digitalmars.com> wrote:
>  >> D has borrowed ideas from many different languages. The trick is to
>  >> take the good stuff and avoid their mistakes <g>.
>  >
>  > How about this one:
>  > 
> http://sadekdrobi.com/2008/12/22/null-references-the-billion-dollar-mistake/ 
> 
>  >
>  >
>  > :)
> 
> I think he's wrong.
> 
> Getting rid of null references is like solving the problem of dead 
> canaries in the coal mines by replacing them with stuffed toys.
> 
> It all depends on what you prefer a program to do when it encounters a 
> program bug:

What do you define as a bug? Dereferencing a null pointer? Passing a null reference into a function that does not expect it? Storing a null reference in a variable whose later use does not expect one? Unexpectedly getting a null back from a function? ...

You seem to be using the first definition which is meaningless to me. What I need to know is how the null ended up where it was unexpected.

> 
> 1. Immediately stop and produce an indication that the program failed
 
By most definitions above, D does not do this. I have more to say, but ran out of time to type this. I'll add more later...



More information about the Digitalmars-d mailing list