3 ms·
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
by tomjen3 4y ago
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.