Book Review: Learning GO Programming
February 1, 2023
This is the fifth in my series of best books to learn Go in 2023. Here’s the index for 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 (this post)
- 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
- Get Programming with Go by Nathan Youngman and Roger Peppé
- For the Love of Go by John Arundel
Learning GO Programming: Build Scalable Next-Gen Web Application Using Golang by Shubhangi Agarwal, 324 pages. Published January 2, 2021 by BPB Publications.
While this book claims to provide “help for those who don’t have any programming experience,” in my opinion a basic understanding of at least one other language would be a prerequisite before getting much value from this book. At several places, comparisons are made to other languages, and most of this material is not truly primer type content, as it assumes you already understand what variables are, basics of how memory works in a computer, etc.
Although it’s quite fair to say that no prior experience with Go is required or expected. This is targeted squarely at beginners to Go.
This book is written in a fairly conversational style, although in a dialect I’m not especially comfortable with. The author, from India, writes in a voice and dialect that I, as an American, find to be a bit jarring and even confusing at times.
However, aside from the difference in dialect, it takes active effort on my part to look past the glaring gramatical mistakes that exist virtually everywhere. Even the subtitle on the front cover contains a grammatical error. And the first page of the book alone contains 8 obvious grammatical errors, not the ambiguities and confusing statements.
For non-native speakers of English, the grammatical errors may go largely unnoticed, but it certainly does nothing to help with the clarity of the prose.
There are also a number of inconsistencies throughout the book. For example, it casually switches terminology between “Golang”, “Go”, and “the Go programming language”.
The best thing about this book is it’s organization. I find it to be exceptionally well organized, which means it would make for a great reference book. The table of contents is quite detailed, and makes it easy to find the topics you care about.
The order of content is pretty typical for an introductory book. First a brief discussion of the anatomy of a Go program, then a dive into data types, variables, and constants before moving on to operators, control structures and functions, before moving onto more more advanced topics.
Each chapter begins with an introductory paragraph, a mini-outline of the chapter, and a list of learning objectives. Each section is further broken into sub-headings, with mostly one- or two-paragraph explanations, interspersed with code examples.
I think this book does an adequate job of covering most of the important topics for a new Go developer.
In contract, some other topics are given an inordinate amount of space. 7 pages are dedicated to walking the reader through the simple task of installing Go on Windows, by clicking through an install wizard that everyone should already be familiar with.
Also absent are some of the usual suspects: Testing is completely absent, except for a passing mention that testing is easy in Go (but no examples). As are generics, which itself is expected, given the age of this book. What’s less forgiveable is the absense of any discussion of Go modules.
If this had been the first book on my reading list, I would probably have been pretty harsh about some of the inaccuracies I found. But after having read Beginning Go Programming, this one feels refreshingly accurate.
But alas, there are a number of factual errors. Most of the ones I found are not of much substance, and generally won’t lead the reader astray. Here are a few examples:
- “An array is a set of similar type of elements” (p. 96) — In reality, an array is a set of identically typed elements.
- “Go provides the more powerful, dynamically typed data type slices” (p. 106) — Slices are not dynamically typed. The author probably meant dynamically sized.
- Page 73 talks about call-by-reference, which does not exist in Go. What is actually demonstrated is passing pointers by value. A subtle, but important, distinction lost on many Go newcomers.
- Page 41 claims that goroutines are functions. This is another common, though dangerous, misconception, among many Go newcomers.
- “In Go, strings are immutable and so, they consume more space.” (p. 36) — It is true that strings are immutable, but this has no bearing on space consumption.
- “With [nested packages], we provide a relative import path.” (p. 80) — Go does not permit relative imports (it also doesn’t have a concept of “nested packages”). Fortunately, the code sample is actually correct in this case, only the description was wrong.
Far more frequent than the overt errors, though, are just inaccurate, confusing, ambiguous, or contradictary statements.
- While listing “jumping statements”,
continueare (correctly) included, while
gotois mysterously omitted, and
os.Exit()is oddly included. (pp. 62-64)
unsafe.Sizeof, a function in the standard library, is present in a list of “operators” (p. 55)
erroris listed as a numeric type. (p. 36)
- “Blank identifier works as a placeholder that can have any value” (p. 30) — The blank identifier never has any value. It expressly discards values.
complex128types are oddly listed under both Integer and Floating point types. They really belong in their own classification.
byteis described as “similar to unsigned 8-bit integer”. (p. 36) It’s actually an alias, and therefore identical to a
Finally, there are a number of minor formatting errors and annoyances. Missing spaces exist in several places in the book (e.g. “There canbe a case…” (p. 75)). And the comments in the code listings oddly use the same typeface as the main text, which often makes it unclear whether text belongs as part of the code sample, or a new paragraph of explanation.
The book is of good quality, typical of paperback technical books. The black and white text is sharp, easy to read, and with the exception of a few typographical errors mentione above, well formatted and easy to read. The pages are thin enough that occasionally a darker element (headline or screen shot) can be slightly visible on the other side, but I didn’t find it distracting (or even notice until I started taking photos for this article).
There are a few screen shots in a couple of the chapters, and while they are legible, they’re not always the easiest to read.
I want so badly to like this book. It’s well organized. And I can see that a lot of thought went into the content. But the plethora of trivial grammatical mistakes, and horribly inaccurate terminology are big turn-offs. And there are just much better books out there.
What is the Best Book to Learn Go in 2023?
After reading every beginner's book I could find on Go, here is my recommended #1 book to help you learn the language.
Book Review: For the Love of Go
For the absolute beginner to programming, this book will get you started on the right foot.
Book Review: Get Programming with Go
Written for the absolute beginner, this book will leave most wanting much more.
Improve your knowledge of Go