3 ms·
I’m guilting of writing a “can’t happen” branch (as I’m sure many of us are). I stripped it out before production after verifying it couldn’t actually happen b
by rablackburn 4y ago
I’m guilting of writing a “can’t happen” branch (as I’m sure many of us are).
I stripped it out before production after verifying it couldn’t actually happen but it was something like an artefact of my thinking process while writing the code.
It feels like a kind of assertion of underlying assumptions, and I know enough to know I’m fallible.
I’m always careful to make the error message something reasonable if it ever did actually come up in a tech demo or something though. Anything else is tempting the Fates.
- Aeolun 4y agoI don’t understand why the message would be ‘Can’t happen’ in the first place. I’d always make it something like “If you see this, something entirely unexpected went wrong.” Showing and triggering the error is helpful in itself since it’ll generate a trace and all the attendant stuff.
- cratermoon 4y ago"lp0 on fire" and "PC LOAD LETTER" are two good ones, too.