The solution to "Error handling"...
Meta
jared771 at gmail.com
Thu Jul 9 03:57:54 UTC 2026
On Monday, 6 July 2026 at 15:03:29 UTC, H. S. Teoh wrote:
> On Sun, Jul 05, 2026 at 09:57:55PM +0000, Meta via
> Digitalmars-d wrote: [...]
>> > On 7/3/2026 4:08 PM, Dennis wrote:
>> > > In [The Easiest Way To Handle Errors Is To Not Have
>> > > Them](https://www.dgtlgrove.com/p/the-easiest-way-to-handle-errors), Ryan Fleury gives concrete C examples, but the principles apply to other languages as well. I haven't read Walter's book recommendation "A Philosophy of Software Design" yet, and if you haven't either, maybe that post is more accessible.
> [[...]
>> This guy's mindset insane to me. Rather than have his program
>> crash when it tries to dereference a null pointer, he wants to
>> paper over it and keep going like nothing's wrong. A segfault
>> or an assert triggering is the correct behaviour in this case;
>> it's indicative that something has gone catastrophically
>> wrong, such that execution cannot continue.
> [...]
>
> Then you're missing his point. If you skim over his article,
> it's easy to pick up the part about using nil structs or "fake"
> pointers, but miss the other, equally important, part about
> writing your code in such a way that *it's still correct when
> passed a nil value*. Without this second part, you immediately
> run into all the problems that you mention.
I see your insinuation, but I read the article multiple times
before posting my original message.
More information about the Digitalmars-d
mailing list