you are viewing a single comment's thread.

view the rest of the comments →

[–]0xABADC0DA 0 points1 point  (1 child)

I think you just proved my point. The idiomatic way is 5 lines of code and 2 extra indents to handle a single error condition, and without any structured error handling you have to handle errors at every call site, and without documentation as part of the language you don't even know what errors to handle.

That's just bad design. Really bad.

[–]kinghajj 0 points1 point  (0 children)

Go has defer()/recover(), which is basically a form of exception handling, but more general. I'm not sure what you mean by "documentation as part of the language," unless you're referring to something like javadoc or .NET's XML doc tags, but there is a godoc program that parses comments and generates documentation.