4 ms·
> The one thing rust doesn't let you do (at least without warnings), is to have unhandled errors. Sounds a bit like Java's checked exceptions, largely regarded
by MrBuddyCasino 12y ago
> The one thing rust doesn't let you do (at least without warnings), is to have unhandled errors.
Sounds a bit like Java's checked exceptions, largely regarded as a failed experiment. What makes Rust's version better?
- kinofcain 12y agoThat there are no unchecked exceptions.
- pcwalton 12y agoAlternately, it's like Haskell's monads, largely regarded as a workable solution. I think the key difference between checked exceptions and Rust's monadic error handling is that it's very easy to just panic if you don't care about recovering from the error. In Java you have to write "try { ... } catch (IOException e) { throw new RuntimeException(e); }", which is very verbose, and it's a lot less code to just ignore the exception. In Rust it's just ".unwrap()".
- Dewie 12y agoMonads have become a borderline buzzword these days. You're obviously the expert on Rust here, but it feels like it would be sufficient to just call it errors-as-values.