NotNull pointers

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Aug 31 05:32:35 PDT 2011


On 8/31/11 6:46 AM, Steven Schveighoffer wrote:
> On Wed, 31 Aug 2011 01:35:51 -0400, Walter Bright
> <newshound2 at digitalmars.com> wrote:
>
>> On 8/30/2011 6:28 PM, Brad Roberts wrote:
>>> On Tue, 30 Aug 2011, Walter Bright wrote:
>>>
>>>> On 8/30/2011 5:08 PM, Bernard Helyer wrote:
>>>>> On Tue, 30 Aug 2011 16:19:00 -0700, Walter Bright wrote:
>>>>>
>>>>>> Looking for corruption of the data.
>>>>>
>>>>> Why doesn't it check for null, and pass if no invariant is defined?
>>>>
>>>> Because the hardware does the null check for you, which is what a
>>>> seg fault
>>>> is.
>>>
>>> The frequency with which this comes up and the lack of converts to that
>>> point of view ought to tell you something here. :)
>>
>> I am simply baffled by it.
>
> Seg faults are not as useful as asserts. It's a fact. If you have a seg
> fault, you must reproduce the error while in a debugger, or generate a
> core dump. Reproducing not be possible, or might take considerable time.
> Any argument against this is revisionist history. Yes, if I go back in
> time and run it in a debugger for that execution, it would be useful.
> Yes, if I go back in time and change my shell options to generate a core
> dump, it would be useful. If you have an assert, you get a stack trace,
> no need to reproduce the assert in a debugger, or enable non-default
> settings in your shell. It just gives you the information you need.

Good. I'm equally baffled by Walter's neglect of these fairly obvious 
arguments :o).

Andrei



More information about the Digitalmars-d mailing list