News for hackers. Stuff that matters.
Re:Why Go Is Not Good (2014) by nevir on Wednesday December 09, 2015 @01:28PM (#10705664)
Same for me. I tried really hard to enjoy Go, but it became an incredibly frustrating experience.

The language itself was frustrating to me in many of the ways outlined in the article.

The community was similarly frustrating.

One anecdote that really stuck with me was when enquiring about explicit language support for the error handling pattern. E.g.:

    f, err := os.Open("foo.bar")
    if err != nil {
        log.Fatal(err)
    }
It is something you perform extremely frequently, and it takes up an incredible number of lines of code. The response from the Go team was (paraphrased) "We don't see the value in making this pattern more terse when you can just write a macro for your editor to automate it".
Re:Why Go Is Not Good (2014) by gendoikari on Wednesday December 09, 2015 @02:43PM (#10706183)
And this is a clever response if you understand their point: messing with the language it's rarely the correct answer. Do you want to remove some code? How about a function? How about hiding boring details behind more elegant objects? How about using a macro in the editor? And so on... The answer is not (from their perspective) "put some shit in the language".

The problem with Go is that is very idiomatic. If you want to work with Go you need to learn its way, and somehow you need to accept the trade-offs behind its design.

If you do not see any advantages in any way, probably it's not the right tool for you, and that's ok. No problem at all.

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.
Re:Why Go Is Not Good (2014) by fenollp on Thursday December 10, 2015 @04:36AM (#10709749)
This is exactly the pattern that Erlang handles the best:

1. Expect you call to os.Open to not fail 2. Then do stuff with it 2bis. Or the running process will crash, the error logged, bad state won't mess up the flow and a dev can always hot-patch it