3 ms·
Then don't try to recreate the control flow of exceptions. Handle things ASAP; only propagate an `Err` if the function returning a `Result<_>` logically has an
by wizzwizz4 7y ago
Then don't try to recreate the control flow of exceptions. Handle things ASAP; only propagate an `Err` if the function returning a `Result<_>` logically has an error condition. Don't be afraid to panic, unless user data is on the line, in which case register an unwind handler and tiny backup facility if you don't trust your programming ability (hint: nobody should trust their programming ability that much unless they've rigorously (mathematically) proven their code's soundness).
It's a different way of programming, but a more explicit one, and I don't think implicit Bad Thing™ should be easy in a language.
(By the way, Rust has a single-character operator to emulate exception pass-through.)
- tomp 7y ago> Don't be afraid to panic, unless user data is on the line, in which case register an unwind handler Sounds like exceptions.