News for hackers. Stuff that matters.
Re:New in Go 1.20: wrapping multiple errors by tomjen3 on Sunday December 11, 2022 @11:25AM (#33944542)
The problem with GoLang is that they have invented something worse than exceptions.

If I want to read a json file, I have to have a named variable for the file, one for the byte string, and finally one for the parsed object (the only thing I care about).

Then for each statement I have to check if an error happened and return it if it did.

Whereas in something like Haskell I could use a Maybe and compose the functions to only forward the value at each step if it was present. Then at the end I would have a Maybe with the final value, which I could then return to the caller.

Golang makes the most common thing to do as verbose as the least common thing.

There are no comments on this comment yet.