3 ms·
In the 90’s we had a large rush of new people writing libraries for the first or second time. One common source of frustration was instability in the exception
by hinkley 7y ago
In the 90’s we had a large rush of new people writing libraries for the first or second time.
One common source of frustration was instability in the exceptions thrown due to bad states, from bad inputs to networking issues to disk permissions.
You’d get a new point version and suddenly have to rewrite your error handling code so the user still got a reasonable message and/or call to action.
Lesson? Errors are part of your public interface. Write at least enough tests to pin the behavior.
It also helps with false positives for tests. Because if you introduce a null pointer exception for negative numbers while trying to add features or improve performance, that’s probably not what you expected. Certainly not what your users expect.
Test your shit. It takes less energy than the mental gymnastics of justifying why you aren’t.