This is the eighth in my series of best books to learn Go in 2023. Read my conclusion or browse the entire series:
- Go Programming Language for Dummies by Wei-Meng Lee
- Go Programming In Easy Steps by Mike McGrath
- Learning Go by Jon Bodner
- Beginning Go Programming by Rumeel Hussain and Maryam Zulfiqar
- Learning Go Programming by Shubhangi Agarwal
- Go For Beginners by Edward Thornton
- Learn Go With Pocket-Sized Projects by Aliénor Latour, Pascal Bertrand, and Donia Chaiehloudj
- Go Fundamentals by Mark Bates and Cory LaNou
- The Go Programming Language by Alan Donovan and Brian Kernighan (this post)
- Get Programming with Go by Nathan Youngman and Roger Peppé
- For the Love of Go by John Arundel
This is an old book, published in 2016. So it was not originally included in my list, since I’m looking for a current book to cover the important changes to Go in the last few years. But several readers/viewers suggested I included this book in the review, so I’ve given into the peer pressure, and reviewed it. 😊
The Go Programming Language by Alan Donovan and Brian Kernighan, 400 pages. Published October 26, 2015 by Addison-Wesley Professional.
This book does dive into a bit more detail about memory layouts of slices and interfaces, for example, than many of the others, which might be considered a more beginner feature… or a more advanced feature, depending on your view :)
This is a very well-written book. This should come as no surprise, as it has received a lot of praise over they years, and well over 1200 amazon.com reviews, with an average of 4.5 stars.
The writing style is very balanced, in my view. Neither dry, nor overly informal. It does include a number of fun anecdotes, which make the reading feel lighter and more enjoyable.
Overall, I like the organization of this book. The first chapter is a very high-level tutorial of Go, with a number of small, self-contained programs used to illustrate basic features of the language. I appreciate this approach, as it makes the Go language feel immediately accessible and concrete, from the outset.
The next few chapters take the reader through the typical tour of expected topics, building on the conceptes introduces in the previous examples: Program structure, data types, variables, functions and methods, etc.
In the the final chapters we’re introduced to the details of Go’s concurrency model, reflection, and even the
testing package! Yipee!
A number of the topics discussed in this book are in places that aren’t immediately obvious from the table of contents. But the detailed index makes it pretty easy to find them anyway, so I do think this book would make for reasonable reference material. As examples, The Go templating engine is discussed in the chapter on composite types, and XML parsing is discussed in the chapter on interfaces.
You shouldn’t be surprised to hear that the content in this book is quite good… for 2016.
In 2023, however, it’s missing a lot of important information. But before I dive into that, there are a couple of things that surprised me a bit, even for a book published in 2016.
There are a number of topics discussed in this book that surprised me a bit. There’s a section discussing the
html/template packages, and another that goes into the details of token-based parsing of XML. There’s also a fair amount of attention paid to some of the standard library’s graphical features, including creating an animated GIF in one of the simple examples in the first chapter.
It also does an admirable job of discussing the
go tool, which is often overlooked in these introductory books. Sadly, much of the information provided on this topic is outdated by now.
So for 2016, when Go 1.7 was the latest hotness, this is a very complete book.
But 6 years later, with Go 1.20 having just been released, there is sadly a lot missing from this book. I won’t harp on too much, since this is fully expected (and the main reason I’m doing this review series in the first place!). But here are the highlights you’ll miss if you rely on this book to learn Go:
- Go modules. Chapter 10 of this book is almost entirely outdated by Go modules, and any newcomer to Go will get tripped up by this almost immediately when they start their first Go project, and will need some help from Google.
contextpackage was added in Go 1.7, just before the book was published, but didn’t make it into print.
- Error wrapping was introduced in Go 1.13 (2019)
- And of course, generics aren’t mentioned in this book, as they were added in Go 1.18 (2022).
Other than the outdated information about configuring
$GOPATH, and (lack of) dependency management, I haven’t found any errors in this book.
The paperback book is perfectly attractive with black text on white paper. There are a few graphics in the book: Diagrams to illustrate memory layouts, screen shots, or snapshots of images generated by some of the examples. Otherwise, the book is entirely text.
The code samples are well formatted and easy to read.
No complaints at all about the physical book.
I doubt my conclusion here will surprise anyone. This is a great book, but it’s painfully outdated. It has definitely earned the 4.5-star rating it has on Amazon, but in 2023, it’s just not the book you should be reading to learn Go.
All that said, I would be very happy to see an updated version of this book come out!