2 ms·
I don't think it should be "exception vs returned value". First, if you are using a dynamic language, then exceptions make sense. You want to get there quickly
by BiteCode_dev 7y ago
I don't think it should be "exception vs returned value".
First, if you are using a dynamic language, then exceptions make sense. You want to get there quickly, not handle every corner cases.
At the opposite spectrum, if you are writing rust, of course you want something very explicit and extremely aggressive to deal with errors.
They just serve different needs.
Also, exceptions don't have to be implicit, difficulties arise when the code you are using do not or cannot declare what can of exception can happen when you call it.
But if the language let you declare all the stuff you can raise, then there is not much difference.