Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And this is why I think Go-lang and its multi-return is the way of the future. In Go you are required to handle errors. If you want them to go away you have to explicitly use an _ and thats really easy to find in the code and shame the person who did it. Nothing fails silently. Nothing fails via primary return. It is such greatness it is hard to express.


You can easily do multi-return in c, return a struct it just doesn't hold your hand.


But as a language construct and the agreed upon way of returning errors it's much more powerful. Returning a structure you can just ignore the error piece. Returning an error however in Go, you have to explicitly handle it. If you don't, it's literally a compile error.


Or exceptions in many languages for error conditions that you don't want to accidentally ignore.


> And this is why I think Go-lang and its multi-return is the way of the future.

Using multiple returns for such situations is terrible, especially doing so in the way Go does.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: