(non)nullable types

Christopher Wright dhasenan at gmail.com
Sat Feb 14 05:30:04 PST 2009


Nick Sabalausky wrote:
> I still like this that someone else mentioned:
> 
> T? x = something;
> if(x !is null)
> {
>     // x is implicitly "T" here, not "T?"
> }
> else
> {
>     // handle null condition (x is still "T?")
> }
> 
> 

I hate it.

It encourages too much nesting, and it silently changes a variable's type.



More information about the Digitalmars-d mailing list