Lints, Condate and bugs

Denis Koroskin 2korden at gmail.com
Fri Oct 29 02:07:13 PDT 2010


On Fri, 29 Oct 2010 11:58:56 +0400, dennis luehring <dl.soluz at gmx.net>  
wrote:

> Am 29.10.2010 09:26, schrieb Roman Ivanov:
>> They would be a great help in debugging programs, for example.
>> NullPointerException is probably the most common error I see in Java.
>> 95% of all times it gets thrown in some weird context, which gives you
>> no idea about what happened. The result is a long and tedious debugging
>> session.
>
> 100% correct - but to have null-able types help to writer code faster in  
> the prototype phase, and not having them will also change the way  
> developers are "forced" to write code
>
> and there are million developers out there who likes/and use null-able  
> values for flow-control - if the null-able "feature" is removed without
> something that keeps the style working, you will loose them, or much  
> more evil, they will try to code around the non-null-able-style getting
> back to there well known null-able behavior, by using bools, ints,  
> strings whatever -> that will not help in library growth around D
>
> try comming up with an pattern that keeps both pro/cons...

No one is talking about removing nullable references but rather adding  
non-nullable types and making them default. You could still achieve old  
behavior if it is needed (most proposed proposed syntax):

Foo? foo = stuff.find(predicate);
if (foo is null) {
     // not found
}


More information about the Digitalmars-d mailing list