2 ms·
This is a brilliant example of why you'd want exceptions. Look at what you're doing for error handling, manually every time. You say that like safely handling
by EpicEng 13y ago
This is a brilliant example of why you'd want exceptions. Look at what you're doing for error handling, manually every time.
You say that like safely handling exceptions is trivial. Exceptions are emphatically not "better in every way", they are a mixed bag. They offer many clear benefits (some that you have described here), but at the cost of making your code more difficult to reason about. You essentially end up with a lot of invisible goto's. Problems with exceptions tend to be much more subtle and hard to debug.
I'm not against them at all, and often I prefer them, but there are certainly downsides.