5 ms·
I agree that it does demonstrate defensive programming. But can I also just add that the error message remains unhelpful and outright "bad." You should absolut
by Someone1234 11y ago
I agree that it does demonstrate defensive programming.
But can I also just add that the error message remains unhelpful and outright "bad." You should absolutely have checks for "impossible" situations, but when those checks fail you need some way of determining which check failed (and cannot always assume you'll have stack backtrace, in particular if an end-user is telling you the error message).
For example you could do this: "Impossible Error in GetName(): {Exception}"