2 ms·
> If you added multiple returns to every function and manually propagated every error you'd get exactly the same thing as try/catch. You'd get the same control
by lmm 7y ago
> If you added multiple returns to every function and manually propagated every error you'd get exactly the same thing as try/catch.
You'd get the same control flow, but it would be visible in your code instead of invisible/magic.
> It's existence comes from not wanting to do all this pointless boilerplate and instead having the compiler do it for you.
Right, but making it be completely invisible goes too far - it's the same problem as AOP.
Either gives you the best of both worlds - minimal boilerplate, but you can still see what's going on.