Better HN
topnewbestaskshowjobs
Log inSign up

poweroftrue

0 karma · joined Mar 26, 2018 (8y ago) · 2 submissions

Submissions

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

Thank God!