Comment by Miiko
5 years ago
Do not quite agree with "safely continue" - at the moment you got ArrayIndexOutOfBounds that unvalidated value might be already stored somewhere / used for changing the state, and it may be not possible to revert those changes easily (or at all).
Danger of core dump in MT case is a valid point, though. However, one can argue that "unsafe to crash" is an indication of poor architecture decision - e.g. saving persistent state to file should be done by writing to new file first, and only replacing old file after that is completed (but I kind of agree, this may be hard to make 100% reliable)
P.S. on the other hand, looking on your other comments in this thread, I do agree with your point - yes, there are cases indeed when you have an assurance the error could not corrupt the state / propagate to other part of the program, then logging error and not crashing is a better option. That's rarely happens in my projects, but this is specific of what I'm doing, and does not invalidate the point.
No comments yet
Contribute on Hacker News ↗