Re:On the uses and misuses of panics in Go
by cygned on Thursday August 09, 2018 @03:54PM
(#17727895)
I cannot value if it is good or bad, but Go’s error handlig is really very verbose. On the one hand, it makes it quite easy to follow control flow but on the other hand it’s annoying to see an if err != nil on like every other line.
[ Parent
| on HN ]
Re:On the uses and misuses of panics in Go
by tshannon on Thursday August 09, 2018 @04:41PM
(#17728281)
Yep, which really explains why Go went with it. The Go authors have stated that it's designed for code to be read more than it's written, so they add verbosity in favor of clarity.
Re:On the uses and misuses of panics in Go
by usefulcat on Thursday August 09, 2018 @04:52PM
(#17728388)
Whether that verbosity improves 'clarity' depends on what exactly you're most interested in seeing. If you primarily value being able to see the control flow for error conditions, then it does indeed improve 'clarity'.
However, regardless of what you value, that increased 'clarity' necessarily comes at the expense of the readability of the non-error control flow.
Re:On the uses and misuses of panics in Go
by tapirl on Thursday August 09, 2018 @06:17PM
(#17729045)
necessary "if err == nil"s never do bad.
I did found some Go code contains many unnecessary "if err == nil"s, however I think this is not the mistake of Go, it is just thant some Go programmers misuse them.