Live data from Hacker News

Why I Don't Like Golang (2016)

teamten.com

1–10 of 297 posts

Re: Why I Don't Like Golang (2016)

#3
This article is from 2016, but it's still relevant. Even in medium sized projects I've been bitten by many of these issues, and for a language that's supposed to eschew magic, there's an awful lot of wizardry going on.

Stopping compilation with an error for every unused import & variable is particularly annoying, so much so that I've patched the go compiler to treat them as warnings instead [1].

Ultimately, I think the problem boils down to a language that outgrew its original design, and hasn't evolved elegantly (yet).

[1] https://github.com/kstenerud/go

Re: Why I Don't Like Golang (2016)

#6
I have been using Go in production since 2015 and can honestly say that other than the ternary operator, none of these have been a major issue for me. Granted, I am doing mostly REST API development so my use cases may be different, but I have never had an issue with capitalization or which interfaces are implemented. The tooling is by far some of the best I have used in a language. Paired with a good editor (I personally use VS Code on Ubuntu 18.04 as my main setup) and I have yet to miss exceptions or wonder what my code is capable of doing.

That being said, Go isn't perfect by any stretch. Sometimes panic ins Go routines can be very hard to trace. The transition to Go modules is challenging for larger projects with versions beyond 1.x (when I started it was Glide, then dep, now go mod, which has been a bit frustrating). However, I wouldn't go back to Java, C#, PHP, or NodeJS if I had the choice.

My go to in the server space is Go and Elixir. I don't feel a desire or need for anything else, but again, that's me. You know your use case better than a stranger on the internet :)

Re: Why I Don't Like Golang (2016)

#8
Unrelated thoughts:

> Structs do not explicitly declare which interfaces they implement. This is done implicitly by matching the method signatures. This design makes a fundamental error: It assumes that if two methods have the same signature, then they have the same contract.

Isn't this just duck typing? Don't other languages renowned for their type systems do this?

> There’s no ternary (?:) operator. Every C-like language has had this, and I miss it every day that I program in Go. The language is removing functional idioms right when everyone is agreeing that these are useful.

Expressive if/else is much more readable. Of course if Go doesn't have that, removing the ternary operator is a bad call.

> The tried and true approach of providing a compare method works great and has none of these drawbacks.

Hmm... except in anonymous cases. This author clearly has some Java stockholm syndrome.

> The append() function modifies the array in-place when it can, and only returns a different array if it has no place left.

That's horrifying.

Re: Why I Don't Like Golang (2016)

#10
post #7

I'm surprised that someone can use Go for 3 years and still be hung up on the things that most people appear to get over in the first month.

Well, it's preference. Some people "get over" things, but when there are so many tools at your disposal, why not use the one you like best?
Post reply on HN