2 ms·
> Now how is that any different from raising an exception? (Other than the extra 'if error: return error, result' lines you need.) I think exceptions can be us
by wyldfire 8y ago
> Now how is that any different from raising an exception? (Other than the extra 'if error: return error, result' lines you need.)
I think exceptions can be used well in some contexts but I will completely concede the point that they're super complicated.
"How is that any different?" Well -- we unwound the stack automagically and that's not trivial. Every intervening piece of code should know that a call they make could transitively make lots of interesting calls and they might cause this function we're writing to exit early.