Disallow null references in safe code?

Meta jared771 at gmail.com
Sun Feb 2 09:41:58 PST 2014


On Sunday, 2 February 2014 at 12:42:47 UTC, Jonathan M Davis 
wrote:
> On Sunday, February 02, 2014 12:52:44 Timon Gehr wrote:
>> On 02/02/2014 04:39 AM, Jonathan M Davis wrote:
>> > I'm not sure how I feel about that, particularly since I 
>> > haven't seen such
>> > data myself. My natural reaction when people complain about 
>> > null pointer
>> > problems is that they're sloppy programmers (which isn't 
>> > necessarily fair,
>> > but that's my natural reaction).
>> 
>> There is no such thing as 'naturality' that is magically able 
>> to justify
>> personal attacks in a technical discussion, even if qualified.
>
> Would you prefer that I had said "initial reaction" or "gut 
> reaction?" I'm
> just saying that that's how I tend to feel when I see 
> complaints about null
> pointers. I have never accused anyone of anything or otherwise 
> attacked them
> because they complained about null pointers. That _would_ be 
> rude.
>
>> The situation does not have to be unbearable in order to
>> improve it!
>
> True, but I don't even agree that null pointers are that big a 
> deal in the
> first place. If we really want to add non-nullable pointers or 
> references to
> the language, then we can. I don't think that that's 
> necessarily a bad idea.
> But I doubt that I'll use them often, and I do think that the 
> whole issue is
> frequently blown out of proportion.
>
> - Jonathan M Davis

Ideally you'd be using them wherever you use objects and 
pointers, as they'd be the default.


More information about the Digitalmars-d mailing list