Skip to content

Comment on Discussion: Reduce error handling boilerplate in Golang using '?'

Comments

This change would mark a turn in the language's evolution, as it would be the first implicit variable to be added to the language.

I'm not going to invoke the slippery slope argument, but what distinguishes Go from the pack is how explicit it is. It can make it more tedious to write, but also much easier to follow as a reader.

It is not more explicit than C, Pascal, JOVIAL and many other predating it for decades.

there's some precedent in the direction of adding predeclared identifiers for error handling: the identifier `error` was originally not predeclared, you had to import it from `io` (or maybe `os`?) and refer to it as `io.Error` everywhere.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.