HNHacker News
TopNewBestAskShowJobs

poweroftrue

0 karma · joined March 26, 2018

submissionscomments
poweroftrue··on Declined Proposal: A built-in Go error check function, “try”
Just try writing three Go programs with error handling, then, try other languages!

I was pissed at first. However, now I cannot code in any language without overusing try and being scared of each line.

Using Go's error handling is actually making your code smarter, I mean, you don't want your code to break with a weird message because of something stupid.

The simplest example is adding a default-path whenever I'm reading a file, Go's error handling reminds me of what to do if this file doesn't exist! Or cannot read etc.

Don't take my word for it, Go ;) try it.

poweroftrue··on Declined Proposal: A built-in Go error check function, “try”
Thank God!