News for hackers. Stuff that matters.
Re:Why Go Is Not Good (2014) by vardump on Wednesday December 09, 2015 @02:34PM (#10706127)
Well, as a mainly C++ programmer, I'd trade exceptions for that any day.

Much easier to understand what is going on, no need to find out if something in the call graph of the method I call throws or not. Also error handling code is where the error occurs, not some completely different place.

Properly handled exceptions aren't any less code anyways. Unless you can just drop everything on the floor.

Re:Why Go Is Not Good (2014) by acjohnson55 on Wednesday December 09, 2015 @03:11PM (#10706365)
As a Scala coder, I'd say you can have it both ways by encoding the result as type that can have success or failure cases. No fancy control flow needed, just pattern matching.
Re:Why Go Is Not Good (2014) by nevir on Wednesday December 09, 2015 @04:26PM (#10706872)
Yeah, and you can implement that in C++ very easily, too. Googlers might recognize StatusOrReturn, and similar macros.
Re:Why Go Is Not Good (2014) by masklinn on Wednesday December 09, 2015 @04:44PM (#10706988)
You don't get pattern-matching though, and I expect the implementation would be somewhat gnarly without native tagged unions. At least now that C++ has lambda expressions you can get all the nice HoF so the usage side of the equation has become less troublesome.

Still, a far cry from

    data Result a b = Err a | Ok b
Re:Why Go Is Not Good (2014) by nulltype on Wednesday December 09, 2015 @02:47PM (#10706204)
I think you mean you'd trade exceptions for that.
Re:Why Go Is Not Good (2014) by vardump on Wednesday December 09, 2015 @02:51PM (#10706233)
Fixed.