3 ms·
Checked exceptions are a hassle. They don't mix well with other types, they don't generalize well. Unchecked exceptions are well, unchecked. Allowing unchecked
by marcosdumay 6y ago
Checked exceptions are a hassle. They don't mix well with other types, they don't generalize well.
Unchecked exceptions are well, unchecked. Allowing unchecked things would completely compromise the Rust safety for no gain at all.
But well, I'm not sure what you are complaining about. The examples where the error is not treated at the point it happens look quite similar to what a try-catch would look. What code do you think error handling gets in the way of the "normal" path?
- throwaway8941 6y agoThat's not what safety means. panic! is perfectly safe Rust. https://doc.rust-lang.org/nomicon/meet-safe-and-unsafe.html https://doc.rust-lang.org/nomicon/meet-safe-and-unsafe.html
- dllthomas 6y ago> They don't mix well with other types, they don't generalize well. I think this is very true of Java checked exceptions. I am not sure this holds up if we actually offered a more sophisticated language for talking about exceptions. Some of my recent comments on the topic: https://news.ycombinator.com/item?id=24454663 https://news.ycombinator.com/item?id=24454663 https://news.ycombinator.com/item?id=24448865 https://news.ycombinator.com/item?id=24448865