Hacker News new | ask | show | jobs
by cy_hauser 1306 days ago
Google's Go language is well suited for back-end code. However, it's a very opinionated and quirky language. If its style suits you it's a great choice. If, after looking at it for a bit, it doesn't sit well then nope.
1 comments

What did you find to be quirky?
Go error handling is a bit rough. It's not hard to write the errors but they can derail my mind when I'm reading Go code. They're like walking up stairs where every fourth or fifth step is slightly higher or lower than the rest. If I want to take my mind off of them -- nope! I'm forced by their unrelenting placement to think about them again. Lots of Gophers get used to them though so it's a very subjective thing.

Some other (well known) quirks are:

-- Forced code formatting for everything. If you don't like it you'll probably never like it. It's mostly a problem if you're switching languages often.

-- Lots of little things you'll stumble on that have to be internalized. Loop parameter scope, variable shadowing, randomization of map iteration, the way slices spring to life but maps don't, colon-equals with multiple variables, no unused variables, etc. There are lots of "Go Gotcha" lists around and I believe there's even a book about them. Every language has them but they're especially noticeable in Go because (1) the rest of the language is so easy to pick up that they tend to stick out and (2) they can't be fixed because Go has a backwards compatibility guarantee that no breaking language changed will be introduced.

Anyway, I really enjoy Go. None of this is enough (IMO) to prevent anyone from at least giving it a try and seeing how it suits them.

Not OP, but I find the Go compiler very frustrating. I cannot leave unused variables or unused imports here and there… which means I cannot have fun writing throwaway code while “hacking” on personal projects. Sometimes I just want to open my text editor and write code while getting quick feedback from the compiler, but Go literally takes away the joy of coding for the sake of coding.

Besides that, I like the language to some extent.

Not OP, but at the very beginning I found quirky:

- checking for "if err != nil {" boilerplate

- having $GOPATH instead of using the current directory when setting up a project. This one is not a problem anymore I believe.

Ah ok. I see those a lot and was just curious if there was anything new or unresolved. It's a fine language. If you enjoy Rust or Zig, I'd recommend it on your day off.