Null references redux
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sat Sep 26 18:24:44 PDT 2009
Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> Walter Bright wrote:
>>> Even forcing an explicit initializer doesn't actually solve the
>>> problem - my experience with such features is programmers simply
>>> insert any old value to get the code to pass the compiler, even
>>> programmers who know it's a bad idea do it anyway.
>>
>> I think you're starting to be wrong at the point where you don't
>> realize that many bugs come from references that people have forgotten
>> to initialize. Once you acknowledge those, you will start to realize
>> that a reference that must compulsively be initialized is valuable.
>
> The problem is it's worse to force people to provide an initializer.
You're not forcing. You just change the default. Really, it's *exactly*
the same deal as with = void that you're so happy about.
Andrei
More information about the Digitalmars-d
mailing list