|
|
|
|
|
by ncmncm
2021 days ago
|
|
Every pre-, post-, and invariant condition violation represents a programming error, at an indeterminate point in the past, rendering the state of the computation unknown, and likely undefined, and definitely unrecoverable. An exception, by definition, is to enable recovery from externally imposed events in a well-defined program state. The only useful, meaningful response to discovering a contract violation is termination. Throwing an exception is the worst imaginable response. |
|