|
|
|
|
|
by typical_gopher
1324 days ago
|
|
My only complaint about go error handling is that they are not encoded as unions/sum types/variants/choice types (whatever you want to call them), so in practice this leaves us the chore of checking and passing zero values and nils everywhere. Sugar for error handling is already a solved problem (.e.g: Rust, Swift, or Zig). Go will be damned by the community's NIH syndrome. |
|
Sum types + pattern matching + tuples alone are so powerful, they could fix like top 5 of my biggest annoyances with Go.
Add some syntax sugar (like '?' from Rust), and it fixes a majority of the boilerplate issues.
Imo, people praise Rust too much for the ownership and safety story, and way to little for its (more simplistic) excellent decisions around simple types.