What I like about Go
By Sean E. Russell on on Permalink.
Someone on Lemmy made the mistake of asking me what I liked about Go, and I accidentally wrote an essay. Since it consolidated a lot of thoughts I had, but had never expressed; and since it also included some references; and since it was long; I decided to copy it here lest it be lost in the mists of time. Which it’s doomed to do anyway. Nobody’s going to give a crap about this in ten years, including myself, after I die.
Anyway, here it is, almost verbatim (sans thorns).
I mention Java a lot below because I spent 15 years as a Java programmer; I started using it just after it was renamed from Oak, so it’s probably the 2nd or 3rd language I’m most familiar with.
- It’s a relatively simple language, and I agree with most of the core design philosophies and standard practices: one way of doing any given thing; short variable naming and limiting redundancy in API calls1.
- It has a reasonably small and remarkably self-consistent, yet comprehensive core library.
- It has a backwards compatibility guarantee: within a major Go version, a newer Go compiler will always compile old Go code. Go 1.27 (2026) is guaranteed to compile Go 1.0 (2012) programs.
- Cross-compiling is a first-class operation and always has been.
- It is one of the fastest compiling of compiled languages, and remains so since preserving compilation speed is a key consideration of any language change the core team makes.
- It produces self-contained binaries, either statically linked or with a very small dependency lib list (unless CGO is used; then all bets are off); this self-contained nature includes mechanisms for embedding assets (images and other files) in binaries in a standard way – deploying a Go application is often just copying a single binary.
- It has pretty good type inference.
- Concurrent programming is stupid simple and has been a core feature since day one, and the footguns are fewer and easier to avoid (fewer “best practices” to remember and follow) than in many languages.
- Channels – now a common language feature, they weren’t when Go was introduced0 – are pretty fantastic.
- the garbage collector is among the best in industry and is completely competent without all of the sort of tuning the Java GC requires.
- It is easy to write code that doesn’t leak memory, and the compiler does a good job of producing binaries which are decent about memory use.
- It’s produces fast executables – it isn’t at the top, but it’s near the top, for execution speed.
- I personally believe the Go team did a pretty great job on generics, and balanced compilation speed with capabilities; you can’t do everything you can in all other languages with generics, but you can do most of the common stuff, and it still compiles fast and doesn’t bloat the binaries (the two usual generics trade-offs). Code with generics is still pretty readable, unlike Java which gets pretty insane pretty fast especially when combined with other Java “best practices” like factories.
-
there is a metric ton of tooling around Go development: IDEs, security and best-practices checkers, any number of unit testing libraries to flesh out the core
testinglibrary, a great debugger and LSP, static analysis tools, heat maps, a built-in race condition checker, a few REPL tools like gore – there’s just a ton of tooling you can pick up as you go to improve your development quality-of-life. - Go modules and the version algorithm are, IMHO, one of the great under-recognized developments in modern software. I believe minimal version selection was a brilliant idea: it was innovative and utterly bucked the trend of maximal version selection which was de rigueur for languages at the time, and was probably Russ Cox’s most significant contribution to modern software engineering.
But, basically, Go makes it easy to hack out pretty OK code pretty quickly – it makes the common case simple, and the uncommon possible. It doesn’t require a great developer to produce decent Go code – and it’s a great feature because I spend a fair amount of time reading other people’s code. My own code is “other people’s code” when I haven’t looked at it in a year or two.
If I had to pick “one” killer feature, though, it’d be that it’s a typed language with blazing compilation speeds. It’s not unreasonable to use it as a scripting language, with a go run shebang0.
It’s not perfect. Some people don’t like that it doesn’t have manual memory management. Although I appear to be in the minority, I find the error handling to be awkward and intrusive. It doesn’t have tuples. Binaries are pretty large compared to other compiled languages, because the Go runtime – which makes so many programming tasks easier – is not small: binaries can be 10x the size of a V or Rust program doing the same thing, or more.
Ultimately, what I like about Go far outweighs what I don’t like about Go, and that’s why I stick with it. I like V more, but V isn’t yet – and may never be – mature enough for any random project I think of.
If I were still a career developer, I’d much rather be in an organization using Go, because reading other people’s Go code is not much different from reading my own0. And for my own personal projects, Go can fit any niche I want: there are TUI libraries, cross-platform GUI libraries, libraries for just about every protocol or syntax you can imagine, and in almost all cases I can develop on my Linux computer and cross-compile for most major OSes0. If I don’t do any programming for a couple of months or jump back into one of my FOSS projects after a year, I never struggle with Go or the core library APIs – it’s always only my own logic and structure that I have to re-learn. Ruby was even more intuitive0, but I’ve never worked with another language besides that which was as “obvious” as Go.
If you have a procedural language background, like C or Java, Go was designed for you to be easy to pick up. Modules introduced0 some “getting started” complexity, but installing Go and writing and compiling a hello world is trivial. the syntax has very few surprises for people with procedural programming experience.
-
E.g. it’d be
File.Open()and notFile.OpenFile(); and throw-away variables such as loop indexes are acceptably “i” or “idx” and not “indexOfArrayStructure”. 0: Go didn’t invent channels; they were inspired by CSP and prior Pike languages. But Go’s concurrency and data sharing models have been influential and you find them in many newer languages. 0:bash $ cat test.go ///usr/bin/true; exec /usr/bin/env go run "$0" "$@" package mainimport “fmt” import “slices”
func main() { hw := []rune slices.Reverse(hw) fmt.Println(string(hw)) } $ chmod +x test.go $ time ./test.go Hello world ./test.go 0.11s user 0.04s system 146% cpu 0.107 total
[^4]: An exception is new Go developers, who often bring philosophies from their old programming languages and try to squeeze them into Go. You can tell Java developers just by the patterns they use, and usually they're unnecessary patterns and idiomatic Go patterns mesh better. [^5]: Cross-compiling architectures is well supported, but any CGO code (which is often GUI code) can be troublesome. there are several non-CGO GUI libraries, but my favorite GUI toolkit right now is [gioui](https://gioui.org) and it is a major PITA to compile it for cross-architecture. [^6]: But Ruby is interpreted, and it has a lot of other problems. [^7]: You don't have to run `go init`, but it's more or less the first thing most Go developers do in a project, and it requires [naming, which is hard.](https://martinfowler.com/bliki/TwoHardThings.html).↩︎︎