null and type safety
Robert Fraser
fraserofthenight at gmail.com
Tue Nov 4 22:29:31 PST 2008
Walter Bright wrote:
> Jarrett Billingsley wrote:
>> Dereferencing a null pointer is *always* a bug, it doesn't matter how
>> "safe" it is.
>
> Sure. But I'm interested in creating a safe subset of D, and so the more
> correct interpretation of what constitutes "safety" is important.
>
>> Don't you think that eliminating something that's
>> always a bug at compile time is a worthwhile investment?
>
> Not always. There's a commensurate increase in complexity that may not
> make it worth while.
>
> My focus is on eliminating bugs that cannot be reliably detected even at
> run time. This will be a big win for D.
FWIW, I've _never_ run into a bug const could have prevented. OTOH, I've
often run into bugs that non-nullable types could have prevented
(including one on a production system... well, there was another bug
that raised an exception causing something else to be uninitialized and
the system came crashing down).
More information about the Digitalmars-d
mailing list