Why I like Go
I have a few side projects, published and unpublished. By trade, I’ve come to programming as a Java programmer. I started coding directly against the Servlet API and have coded using Enterprise Java Beans, Play Framework, Spring Framework, and even some Scala. Lately, I’ve been coding mainly in Go with some Python.
Go is a really nice programming language. Some people like it for its simplicity. I want to offer a different take on why you should learn and use Go for your own projects.
Go is a fast language to write code in. The Go compiler is really fast. For my side project, which contains 39 source files, compiling and running the entire binary feels nearly as fast as running a Python script. It’s hard to quantify why this speed is important. But I believe it is the top reason why I’ve stuck with Go (even though I prefer Scala’s type system). It feels liberating to be able to code, write tests, and run the program quickly and smoothly. Scala is on the opposite end of the spectrum when it comes to the speed experience. I still remember the frustration of writing a trivial Spark program (for a side project) and seeing how much time it took to run a simple test case, and how much it taxed my IO and CPU.
The other aspect of Go that makes it sticky for me is the tooling. In contrast to Go’s compiler and package manager, Java and Scala’s tooling feel hard to use and incomplete. I recall my joy when I first learned about Maven. It was such a huge improvement from using Apache Ant, which was an evolution from make files. However, Maven’s collection of plugins feel halfbaked and inconsistent. This is understandable - the Maven community evolved from hundreds of independent contributors over decades of development. Go had the opportunity to apply learned lessons and build a streamlined and simple to use toolchain. Compilation, dependency management, testing, and benchmarking are streamlined and consistent. Scala, again, is on the opposite end of the spectrum. You can learn the Scala programming language in a week. But you’ll likely spend months learning how to use SBT effectively. I hate wasting time learning tools and frameworks of a programming language. I’d rather be spending my time writing code.
I will one day write an article about parts of Go that I hate, e.g., generics (missing), tedious error handling, and lack of tuning knobs on the GC. But today I want to praise Go for being fast. It’s lovely language to code with.