Re:Errors – Gotta Catch 'Em All
by wyldfire on Thursday April 04, 2019 @10:57AM
(#19573058)
> 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.
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.