Null references (oh no, not again!)

Nick Sabalausky a at a.a
Wed Mar 4 12:06:20 PST 2009


"Joel C. Salomon" <joelcsalomon at gmail.com> wrote in message 
news:gomli7$15sj$2 at digitalmars.com...
> Walter Bright wrote:
>> I've used compilers that required explicit initializers for all
>> variables. Sounds great in theory, in practice it *causes* bugs.
>>
>> What happens is the compiler dings the user with "initializer required."
>> The user wants to get on with things, so he just throws in an
>> initializer, any initializer, to get the compiler to shut up.
>
> Then the compiler is giving the wrong warning; it ought only to warn
> that the variable is used before it has been set.
>

Agreed.

But let me pre-emptively address the inevitable "That would require flow 
analysis" that is scheduled for this point in the discussion:

I've been thinking more and more that flow analysis is something that really 
needs to just get done for D at some point (I sympathetically realize that 
there are plenty of other things D also needs addressed). I'm no expert at 
this, but from prior discussions it sounds like this is something that's 
fairly well-understood. That together with the fact that the lack of it 
seems to be becoming more and more a stumbling block for various "very good 
things" leads me to beleive this is something that needs to just get done 
for D. 





More information about the Digitalmars-d mailing list