Go: a Grumpy Old Developer’s Review
I first started programming in C, about twenty years ago. I pretty regularly call myself a grumpy old man – I always thought that describing myself as “grumpy” was legit, but that the “old” was a joke.
It turns out that twenty years is a long time.
I’ve got my copy of K&R (if you don’t what K&R is [like Laine didn’t, who is apparently neither grumpy NOR old…], sigh/get off my lawn, look up the authors), and it’s still my favorite programming book. I still love the simplicity of the C language. I’ve written in languages that do garbage collection and languages that don’t even bother to mention that they do garbage collection for you. I’ve seen so many different kinds of inheritance it makes me mildly disturbed to think about it.
I’ve learned JEE, Spring, and Spring Boot, and I’ve wandered around other people’s Python code. But I still have my love for C. It’s easy for me to read, easy for me to follow, and unless you’re doing something dumb with pointers, it’s pretty easy to figure out what you’re doing, and what you’re doing wrong.
What is Go?
Go (often referred to as Golang) is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is syntactically similar to C, but with the added benefits of memory safety, garbage collection, structural typing, and CSP-style concurrency. (Thanks, Wikipedia!)
Go is a relatively simple language. It runs fast, and it can be (and is!) used for most anything, from simple script work to heavyweight applications and services. It’s a general purpose language like Java but it doesn’t require a JVM or interpreter. It’s safe because variables can’t be magically converted – so you always know an int
is an int
.
In C, you can take a memory pointer and do some math to get to other memory spaces – including memory spaces for other programs. Go, on the other hand, doesn’t allow for Pointer Math of Dubious Magic and so is much more memory-safe.
Why Make Go?
Every language solves some of the problems of the ones that came before it. Really good languages solve almost all of the problems of their predecessors, while some languages just…make things more complicated than necessary.
Go is a reaction to languages that were easy to start but later made you want to die because they had unpredictable behavior or poor performance. For example, JavaScript can be dangerous from a type-safety and parallel processing standpoint and interpreted languages like Ruby and Python aren’t very performant.
Go was also a reaction to languages like C, which is simple and usually very fast but had some complications (e.g. header files) and was missing a lot of modern niceties (garbage collection, memory safety).
What’s my Take? (tl;dr)
As an old C programmer, Go is pretty good. Its similarities to C are useful and familiar. Basically, it’s less garbage than everything else, and it delivers on what it set out to do. It’s like getting into your car ten-year-old-Buick that you love, and you know how it works, and then you find that it has all kinds of new tricks it can deliver.
People who should give Go a shot
- Java programmers who want to get away from the JVM and massive startup times and memory
- Container developers who want fast startup time and simple, clean language syntax
- C programmers who want some modern language niceties
- Ruby and Python developers who want type-safety with the same speed of development