(no title)
Expurple | 1 month ago
Everyone (except Go devs) knows that those are the worst. Exceptions are better, but still less reliable than Result.
https://home.expurple.me/posts/rust-solves-the-issues-with-e...
Expurple | 1 month ago
Everyone (except Go devs) knows that those are the worst. Exceptions are better, but still less reliable than Result.
https://home.expurple.me/posts/rust-solves-the-issues-with-e...
kllrnohj|1 month ago
The ultimate ideal for rare errors is almost certainly some form of exception system, but I don't think any language has quite perfected it.
Expurple|1 month ago
Only when you don't need the Ok value from the Result (in other words, only when you have Result<(), E>). You can't get any other Ok(T) out of thin air in the Err case. You must handle (exclude) the Err case in order to unwrap the T and proceed with it.
> It also litters your code with branches, so not ideal for either I-cache or performance.
That's simply an implementation/ABI issue. See https://github.com/iex-rs/iex/
Language semantics-wise, Result and `?` are superior to automatically propagated exceptions.
drysine|1 month ago
Where people use things like anyhow.[0]
[0] https://docs.rs/anyhow/latest/anyhow/
Expurple|1 month ago