I rag on “if err != nil { return err }”, but I can sort of understand where people who prefer it to try/exceptions are coming from, even though I completely disagree. But I can’t even begin to understand people who prefer hand-written state machines to async/await.
-
-
I think the “explicit control flow” buys nothing at all when panics can cause invisible stack unwinding almost everywhere.
-
Invisible code paths are such a dangerous concept, IMO. In C++, there's a reason you have to manage resources with a designated class, and that's because an invisible error might be thrown, at best causing resource leaks.
- 2 more replies
New conversation -
-
-
In my experience over half the time errors can be propagated without additional context. So map_err is still more succinct for the cases where you want to add it, and then it's an even bigger win when you don't.
-
Yeah, I rarely ever bother. (Though GPU programming is a little weird because you can’t afford to synchronously check errors for performance reasons—error checking is an async operation. So I don’t actually deal with errors in Rust as much as others do nowadays.)
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.