5 ms·
> 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 e
by eta_carinae 14y ago
> 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.
- pmylund 14y agoAnd 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.
- DeepDuh 14y agoSo 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.
- ralph 14y agoYes, it can return a tuple, in Python-speak, and has a pre-declared error type. http://golang.org/ref/spec#Errors http://golang.org/ref/spec#Errors
- icebraining 14y agoIt 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.
- luriel 14y agoAnd 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 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.
- jgrahamc 14y agoNot sure that I deserve to be mentioned in the same breath as Ken Thompson.
- krishnakv 14y agoI 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 :-).
- kaib 14y agoI 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/352949.aspx http://blogs.msdn.com/b/oldnewthing/archive/2005/01/14/35294...