HNHacker News
TopNewBestAskShowJobs

typical_gopher

17 karma · joined November 6, 2022

submissionscomments
typical_gopher··on Thoughts on the “guard” proposal for Go's error handling
> C++ and Java exceptions have non-local flow and it's hard to determine what function can throw what, so if you do want to add error handling cases you would have to inspect every function to know if it throws or not

In general I agree with you, but Rust is already having this problem by people making liberal use of unwrap.

typical_gopher··on Thoughts on the “guard” proposal for Go's error handling
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.