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

> And the fact that it's missing exceptions seems like a win because I much prefer dealing with errors when they occur.

This person doesn't seem to have much experience with error handling.

You shouldn't deal with errors the way you prefer it, you should deal with them the right way. Sometimes, it's where they occur, but very often, it's somewhere up the stack.

We learned this lesson in the 90's.



It seems odd to assume he has that opinion because of lack of experience, considering we're discussing a language developed by people like Rob Pike, who share his opinion on error handling and can hardly be described as unexperienced.


And people like Ken Thompson.

Accusing the author of this article of being "inexperienced" is also very amusing: http://en.wikipedia.org/wiki/John_Graham-Cumming

And even Java and C++ luminaries like Bruce Eckel have come out in support of Go's error handling and against exceptions.


Not sure that I deserve to be mentioned in the same breath as Ken Thompson.


And Go lets you do that. You just return the error.

Try writing a few things in Go. I very much doubt you'll respond like this afterwards.


So I assume it has multiple returns? Some smart built in error class I could actually see that removing the need for exceptions, yes.

One new way I've found interesting in obj c is giving functions (an) error handling block argument(s). It nicely does what java unhandled exceptions warnings do: make the user aware of his actions.


Yes, it can return a tuple, in Python-speak, and has a pre-declared error type. http://golang.org/ref/spec#Errors


I think a lot of people would disagree with your view that non-local exits, of which exceptions are a type, is the right way to go.

Here is a good detailed analysis why exceptions might be a worse choice: http://blogs.msdn.com/b/oldnewthing/archive/2005/01/14/35294...


I think the author addresses this quite effectively in the article starting with:

"I'm sure some people reading this are going to say "But language FrobBub has had NoduleFoos for years cretin!"."

Priceless :-).




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

Search: