3 ms·
For low level code, do you really want to abort on panic? Rust error handling is easily my least favorite part of the language, combining the disadvantages of e
by quotemstr 9y ago
For low level code, do you really want to abort on panic? Rust error handling is easily my least favorite part of the language, combining the disadvantages of exceptions and return codes.
- steveklabnik 9y agoMany do, yes. Panics are non-recoverable errors, and aborting produces leaner code, which is important on embedded.
- quotemstr 9y agoPanics are recoverable though
- steveklabnik 9y agoThey’re not guaranteed to be, so you can’t rely on it. You can say that you do, but then you may cut yourself off from the rest of the ecosystem. Libraries generally can’t rely on either behavior, applications choose.
- quotemstr 9y agoAnd that's why I think the Rust has a worst-of-both-worlds error handling strategy.