4 ms·
Yeah, exceptions and try/catch blocks have way worse ergonomics that Result<Err,Ok>.
by LelouBil 3y ago
Yeah, exceptions and try/catch blocks have way worse ergonomics that Result<Err,Ok>.
- pjmlp 3y agoThen why does Rust need third party crates for sane ergonomics?
- LelouBil 3y agoI'm not really talking about the "errors" ergonomics, but more about error handling. The methods like .map .map_err .and_then I feel are way easier to reason about and also often shorter that what would happen in a control flow breaking catch block.
- veber-alex 3y agoBecause there isn't a one size fits all solution to error handling? Because before anyhow/thiserror became popular there were 5 other popular crates for handling errors and if Rust added one of those to std we would be stuck with a subpar solution forever? Because cargo is so easy to use that your preferred error handling solution is one `cargo add` command away? Because for simple cases the tools the standard library offers are good enough?
- pjmlp 3y agoOr maybe, because the feature wasn't properly developed, and needs community fixes to make it usable.