News for hackers. Stuff that matters.
Re:Go 1.3 is released by gouggoug on Thursday June 19, 2014 @03:12AM (#7914816)
Errors are just return value, but in go, you either explicitly ignore the error returned (using the "blank identifier" _ ), or, you assign it, in which case you have to deal with it (otherwise go will complain about an unused variable).

An that is what makes go awesome. In java or php, you, as a developer, can never know wether the functions you are calling will throw an exception. The only way to know? Read the doc, if you're lucky and there's a doc, or read the code... The result? your program will crash if you didn't add your try..catch block.

Go forces you to either explicitly ignore errors (and your fellow co-worker will know you did it on purpose) or deal with them. No surprises.

Re:Go 1.3 is released by Peaker on Thursday June 19, 2014 @03:17AM (#7914834)
I get the same in C, with gcc's __attribute__((warn_unused_result)).
Re:Go 1.3 is released by aktau on Thursday June 19, 2014 @04:33AM (#7915180)
This comment should be more prominent, warn_unused_result is pretty awesome!
Re:Go 1.3 is released by tmhedberg on Thursday June 19, 2014 @10:31AM (#7916242)
> In java or php, you, as a developer, can never know wether the functions you are calling will throw an exception.

That's what checked exceptions are for in Java.

Re:Go 1.3 is released by gouggoug on Thursday June 19, 2014 @01:28PM (#7917235)
The larger problem with exceptions, checked or not, is that they interrupt the flow of your program, which is too bad since most exceptions are not that exceptional. That problem is exacerbated by developers who don't know how and when to throw exceptions and end up throwing exceptions for easily recoverable errors. The other thing I dislike about exception is that your code ends up with tons of try..catch blocks.