Golang Thinks You are a Bad Programmer

Dane Johnson
Software Engineer Intern

There is a fine line between being idiomatic and being idiotic and Golang walks it like Cash. In the short time I have been using Golang, I have come to dread she who should be my greatest asset as a programmer, the compiler. This stems from one astronomically misguided decision by the creators of the language, namely, to treat non-idiomatic code as erroneous code at compile time.

The reasoning for this is pretty straightforward. By forcing us to write code that upholds it’s conventions, Golang ensures that you have triple checked your bounds, always know your types, and have no side effects hidden away. This is seemingly helpful, but it has significant drawbacks in practice. Namely, you can never make Golang do something the creators of Golang don’t want you to do with it.

If you’re reading this, there is a good chance that you’re the type of person who likes to break things and knows the benefit of breaking. Let me tell you from personal experience, Golang cannot be broken. There are pointers, but no pointer arithmetic (Golang doesn’t think you understand memory). Type casting is explicit and mandatory (Golang doesn’t think you understand dynamic binding). All errors must be explicitly handled or explicitly ignored (Go wants you to know it’s your fault we can’t have nice things).

In the end, there is no substitute for good code. Golang understands that and prevents things with the symptoms of bad code from compiling, but it can’t cure everything. Making me write my code your way just makes me resent you, and limits what can be done with your language. Take a look at good ol’ Javascript, who never told anybody how to do anything ever and is now the most widely used language in the world.

Golang is a great language if you want comfort and security in your code, but I have yet to see any GoCode that blows me out of the water the way Clojure or Python does. Hopefully, as the language matures it will learn to treat its users like adults. Until then, there nothing else to do except hope Google sees its own shadow.