5 ms·
A major hit to readability. Every call site where you want to check for an error requires adding another level of nesting.
by jshen 12y ago
A major hit to readability. Every call site where you want to check for an error requires adding another level of nesting.
- frou_dh 12y agoThat's a different issue. Pattern-matching a sum-type value, though safer, would be "noise" too.
- jshen 12y agoCorrect me if I'm wrong, but I believe with sum types you can chain together multiple calls then pattern match once at the end. In Go you have to check at each call.
- burntsushi 12y agoIf you have an unusual amount of error handling cluttering up your code in Go, then you can use `panic` (with `defer` and `recover` to convert panics to errors in the public interface).
- iopq 12y agoI've been programming without if statements. It feels a lot better using pattern matching instead of if statements.