4 ms·
Programs should never, EVER crash. Oh yes they should. If, for example, the alternative is to continue in an undefined state, potentially corrupting user data.
by zoul 8y ago
Programs should never, EVER crash.
Oh yes they should. If, for example, the alternative is to continue in an undefined state, potentially corrupting user data. Not all error conditions are recoverable.
- feanaro 8y agoThe right question to ask yourself is why this is the only alternative. It almost never is, if the program is properly designed, especially for a user-facing application.
- zoul 8y agoAs an example, the default reaction to accessing an invalid index in a Swift array is trapping. How would you solve this “properly”? Returning an optional (ie. Maybe) would be too cumbersome and wouldn’t lead to safer code in practice.