(non)nullable types

Michel Fortin michel.fortin at michelf.com
Tue Feb 17 19:36:13 PST 2009


On 2009-02-17 18:17:55 -0500, Christopher Wright <dhasenan at gmail.com> said:

> One possible change: implicit casting with an assertion that the 
> nullable value is not null. I'm not sure whether this is a good idea. 
> On the one hand, it's easier for the programmer to use nullable types 
> in that case; on the other, it encourages people not to have error 
> handling.

I think it's a good idea: good enough to be useful, simple enough to be 
implemented without much hassle. Once we have enough code using 
non-nullable, it'll be easier to evaluate the impacts of adding 
compile-time constrains for nullables, and whether it's worth it or not.

I wouldn't make it just like an assertion though. I'd make it something 
separate you can deactiave with a compiler switch, just like bound 
checking.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list