Null references redux

Jesse Phillips jesse.k.phillips+d at gmail.com
Mon Sep 28 12:35:07 PDT 2009


language_fan Wrote:

> > Now if you really want to throw some sticks into the spokes, you would
> > say that if the program crashes due to a null pointer, it is still
> > likely that the programmer will just initialize/set the value to a
> > "default" that still isn't valid just to get the program to continue to
> > run.
> 
> Why should it crash in the first place? I hate crashes. You liek them? I 
> can prove by structural induction that you do not like them when you can 
> avoid crashes with static checking.

No one likes programs that crash, doesn't that mean it is an incorrect behavior though?

> Have you ever used functional languages? When you develop in Haskell or 
> SML, how often you feel there is a good change something will be 
> initialized to the wrong value? Can you show some statistics that show 
> how unsafe this practice is?

So isn't that the question? Does/can "default" (by human or machine) initialization create an incorrect state? If it does, do we continue to work as if nothing was wrong or crash? I don't know how often the initialization would be incorrect, but I don't think Walter is concerned with it's frequency, but that it is possible.



More information about the Digitalmars-d mailing list