3 ms·
It unwinds the call stack until a catch. It is the same "problem" as not knowing where a return will return to.
by rightbyte 4y ago
It unwinds the call stack until a catch.
It is the same "problem" as not knowing where a return will return to.
- arcticbull 4y agoReturn only ever moves up the stack one level. That makes it really easy to reason about. This can move up the stack an unlimited amount, and the handler has to be prepared to properly deal with the current state, no matter where it comes from.
- kortilla 4y agoThis is no different than returning an error in go far down. You don’t know how far up it will be passed or handled.
- arcticbull 4y agoYou do. Errors have to be handled or passed up explicitly at each level. Errors are one level at a time, not 'n'.
- ilyt 4y agoNo, it is not the same problem. You need to trace every function, and every function calling those functions, and every function calling those functions, all the way to catch. You can't "just" search for function name, you have to rely on code analysis tools. Making code more opaque coz you can get thru the mess of it via tooling is terrible direction