Many people working in engineering, or engineering-adjacent, fields (including data) may have heard of the Go programming language. If you haven’t, Go is a compiled, statically typed programming language with garbage collection, memory safety, and a built-in system for CSP-style concurrency. Go was developed as an open source project, largely designed and directed by a team at Google, including some very well-known names like Rob Pike and Ken Thompson.
While Go is unlikely to displace languages like Python (especially), R, and Java/Scala from their central role in the data ecosystem in the immediate future, many teams have found it especially well-suited to infrastructure and service-oriented work—important parts of the data world.
In this article, I’ll explain a little about what makes Go interesting and provide insights on resources for learning Go (which are thankfully quite good).
What makes Go interesting?
Go has several properties that make it interesting relative to other common programming languages, including:
- Go is a compiled, statically typed language (whereas e.g. Python an interpreted, dynamically typed language), which means it’s faster when executed and has some advantages in detecting certain types of programming errors during development (rather than finding them the hard way in production).
- Go has support for concurrency built in. Go’s two most distinctive concurrency features are “goroutines” (allowing any function to be spun off in a light-weight thread) and channels (a data structure for passing messages between threads, to avoid directly sharing memory). Unlike Python with its global interpreter lock, Go can execute multiple threads in parallel.
- Go’s tooling is very good. It comes with a simple way to manage dependencies, a universally-used code formatter, a profiling tool, a friendly build system, and tools for analyzing/linting source code.
- Go has a great deployment story. It always produces static binaries, with your code and all your code’s dependencies compiled into the same binary. This means no dealing with virtual environments or conflicting dependencies between services.
- Go places a real emphasis on keeping the language, and idiomatic Go code, simple and comprehensible. Using standardized code formatting is part of this, but the focus on language simplicity is even more important. Go explicitly seeks to keep the language itself small enough to fit in an engineer’s head. Admittedly, this means Go is missing some features from other languages, including most conspicuously generics, whether permanently or while the developers work out how to integrate them while maintaining that simplicity.
- Go supports composition, extension, and polymorphism via interfaces and embedding rather than classes and subclassing.
How to go about learning Go?
There are some great resources available for learning Go. Some I’d recommend engaging, in roughly this order, are:
- A Tour of Go, which provides an introduction to the language’s features in bite-sized chunks, complete with an interactive editor so you can experiment with the language without installing anything.
- How to Write Go Code, which provides a high-level overview of how Go projects are structured, run, and tested.
- Effective Go, which gets into more detailed/advanced topics needed for working with real-world Go code.
- Go Concurrency Patterns, which introduces practical approaches for writing concurrent programs in Go.
- Advanced Go Concurrency Patterns, which builds on the previous document and in particular addresses some challenges concurrent Go programs are likely to encounter and how to address them effectively.
If Go sounds like it may be a valuable tool to have at your disposal, I’d encourage you to check it out. The language’s simplicity, and the solid learning resources, mean that it’s fairly easy to pick up the basics and start experimenting with its more distinctive features.