Honestly the only real argument I've heard for Golang is that it is "coming from Google so it must be good". Every time I've tried to write in this language it feels like I'm hitting my head with a hammer.
Google might have very smart and knowledgeable people in it but this language is like a bad overhyped C. See next code that all it is doing is parsing a CSV line:
func NewPoint(line string) *Point {
tokens := strings.Split(line, ",")
if len(tokens) != 4 {
return nil
}
var err error
p := new(Point)
// why cannot I declare and assign err in one go??
most of the code has nothing to do with its functionality - it's just error handling that is plain hideous to write and read. Not to mention all the clutter to just convert an integer and a float.
And let's just not go into deeper aspects such as the structs that double as classes and has everyone creating his own style of SOLID and DPs. Or the inconsistent syntax which sometimes looks like traditional OO and othertimes like plain C further confusing users.
I find it very hard to believe that this language would have caught on if it weren't for Google pushing for it so aggressively. And I find it so disheartening to realise that after all these years developer productivity and happiness is merely an afterthought for language designers and that marketing and hype are the main drivers.
And yes I know the saying "there are languages people complain about and languages that people do not use". I find it worthy of high school gotcha sayings to which I reply that language designers of the majority of programming languages have no clue about how to make a language nice to its users. It's as they know how to design a internal combustion engine and then they put a chair and 4 wheels on it and they dismiss complaints about how unreasonably difficult and miserable the driver experience is.
I was recently modernizing a system administration script, and I ended up rewriting in in Go. And yes, I hated Go's error handling every time. So why Go? Because this was the best available option.
I had to talk to AWS, so I needed a language supported by SDK (https://aws.amazon.com/tools/). Existing app was in Python and too slow, so Ruby, PHP, node.js etc.. would not work either. This leaves C++, Go, Java, .NET.
We have a lot of C++ code, but the compilation times are very long, and the proper build system is tedious to set up. And I am not willing to start thinking about pointer types unless I have to.
Java requires dependencies to run, and is really not suitable for system administration tools given it seems to need JNI for anything slightly advanced. Plus I don't want to write .sh launchers for each my application, nor learn about finer details of memory management.
I just don't know anything about .NET -- I've heard that nowadays, you can run it on Linux and don't have to install Visual Studio to develop for it, but I assume I'll be a second-class citizen if I use it like this, and it probably needs runtime anyway.
This only leaves Go, so with Go I went. I was impressed with compilation speed, with the vendoring support, and with the fact that I can just "go run" any app without writing any build files.
I would love to experiment with D or Zig or some other system-ish languages, but they are just too risky for work stuff... I want something used by hundreds of thousands of people so that all the common bugs are caught and fixed.
----
So, did I chose to use Go because "Google pushing for it so aggressively"? On one hand, Google was not involved in my decision. On the other hand, Google definitely helped Go's adoption when they hired and paid all the Go authors, so that the language started with good stdlib, documentation and examples.
What’s your daily driver?