3 ms·
The problem with crashing is that it is almost always a bad idea. You almost always want a limited scope crash that affects whatever currently is being processe
by kccqzy 3y ago
The problem with crashing is that it is almost always a bad idea. You almost always want a limited scope crash that affects whatever currently is being processed. Imagine that in some languages an assertion raises an AssertionError exception which is caught by some faraway handler that causes the server the respond with a 500 error. That's strictly better than crashing.
I also used to think it might be preferable to crash in some domains. With stories like https://news.ycombinator.com/item?id=37461695 https://news.ycombinator.com/item?id=37461695 it makes me think perhaps there are none.
In any case my main point is that assertions would be perfect if only they are checked at compile time.