I think the popularity comes from a number of googlers using HN and upvoting related stories. A lot of go fans seem to be people for whom it's their second language after python (or possibly their fourth language after python, java and c++ - the only languages that google employees are allowed to use, AIUI). So they see a language that's more expressive than java, less crazy than C++, safer and more performant than python, and think it's the best thing since sliced bread.
There are some good things in go. An opinionated formatter that ships with the language is a great idea. Static duck typing is an interesting idea, though IMO less useful than either alternative - it means you can't do the equivalent of newtype, which is something you use all the time when coding in a properly typesafe language because it lets you catch so many errors. If you look at the scala community, there's a syntax for doing this... and almost everyone's agreed it's a bad idea. The concurrency model is... worth pursuit and I'm glad someone's trying it, though ultimately I think it will prove less practical than e.g. Erlang-style approaches.
It's not the worst language ever. But it utterly fails to live up to the hype. I've yet to find anyone who likes it having previously done a serious project in Haskell/Scala/F#/OCaml.
It also seems like the way they resolved a lot of issues in the surrounding tooling was to not decide. For example: how many spaces should we use? Screw it, we'll use hard tabs! How should we handle dependency loading and package management? Screw it, we'll hard-code the URL to our dependencies in the source code! How to handle dependency versions? Screw it, we won't!
It's not a horrible language (like shellscript), but I think they wasted a lot of opportunity to make something better.
> For example: how many spaces should we use? Screw it, we'll use hard tabs!
The only sane choice, and one that, again, goes back decades for these guys. You use one indent character per level of indentation. Boom. If you don't like seeing 8-wide tabs, fix your fucking editor. If you're worried about lining up all your code in perfect multi-line arrangements, maybe rethink your life.
> How should we handle dependency loading and package management? Screw it, we'll hard-code the URL to our dependencies in the source code! How to handle dependency versions? Screw it, we won't!
They should have never done the URL thing; it was a cute demo, but people took it as some sort of commandment to write code that way. If you want a real, stable set of dependencies with control over which version gets used, you should do what C and C++ programmers have done for decades and include the appropriate dependency source code in your distribution. Brad Fitzpatrick (core Go author) does that for Camlistore: https://github.com/bradfitz/camlistore/tree/master/third_par... and I do it for my own projects, if they're more than a quick test.
But...`go fmt` does this for you :-)
type Magic struct {
CastingCost string
Id int
}
Even though I'm not really a fan of the choice myself. func someFunc(arg1 string,
arg2 string,
arg3 int,
) bool
{
and get very angry when the arguments don't line up perfectly under each other using just tabs. And, presumably, that Go won't let you put that { on the next line like that.When I tell these people I often use an editor with variable-width fonts, it damn near gives them an aneurysm.