2 ms·
> the request was rejected because the error case should never happen. I haven't run into this mindset much at my current job. But in general I think I've bee
by wyldfire 11y ago
> the request was rejected because the error case should never happen.
I haven't run into this mindset much at my current job. But in general I think I've been able to lobby for "well, can we at least have a special case that would leave a breadcrumb behind if it does occur?" That way the investigation when it does inevitably occur is swift and there's less debate among ambiguous choices about how to change the design going forward.
I've also found fault injection testing as a great way for disproving statements about what "can never happen."
That said, I've seen the other extreme too -- checking pointers against NULL just prior to dereferencing at every opportunity up and down the stack. In these cases function/module authors succeed only in moving the eventual crash to somewhere far disconnected from the origin of the problem.