DEV Community

Cover image for Head First Go Book Review
Jason Content
Jason Content

Posted on

Head First Go Book Review

Image description

I have recently just finished reading Head First Go by Jay McGavren. When I opened the book, I thought this was a very different way of learning to program from a book.

It's a bit like a school workbook; you have exercises where you need to use a pen or pencil for, and then there are also times when you need to build what they are writing about. My Github Repo for this book is here: https://github.com/jasric89/headfirstgo if you wish to take a look.

I have read quite a few books on Go, and honestly, I get halfway through the book and give up. The reason for this was I had spent the last two years trying to grasp the language, and no book for me personally could do that until I got to this book.

The way Jay McGavren writes is like someone guiding you through the language. Each chapter creates an interesting problem that naturally, your brain kicks in and goes ohh, I wonder how this problem is solved. It's sort of like a Sherlock Holmes episode of who committed the crime. Or an NCIS series, depending on your taste. (If you haven't already figured it out, I like crime series.)

Then there are the exercises where you have to get a pen out and fill in the blanks, which, in an interesting way, really starts cementing what you are learning. For me, when this first started happening. I had to take a moment with a smile and realised oh wait, this is actually going in.

As I said, there are tons of books I have read on Go where you read the chapter, then the Author leaves you an exercise to complete, which really most of that exercise has no real bearing on what you were reading, then you spend most of your time on Stack Overflow trying to figure out how to complete the exercise. Then you get disheartened about why you can't do it; the book gets tossed to the side and back to the drawing board. Not with this book.

The only major drawback with this book is that it was written before modules came out, so essentially, it uses GoPath for a lot of the book. I did head to their website, https://headfirstgo.com/, when I first noticed this problem, but I could not see any notice about the issue or any other versions of the chapters released with the new Go Pkg framework.

At first, this was frustrating because I could not get my head around how Packages work in Go. Yet I was already so impressed with the book that I spent two to three hours more learning how to write packages in Go. I have also written a blog post on it here: https://theclouddude.co.uk/mastering-writing-packages-with-go-when-working-with-the-azure-sdk

This may save you the hours of figuring out how packages work if you give that post a read and then apply it to the parts of the book where GoPath is being spoken about. It could be enough, though, to put the person off buying this book because, essentially, that part is so out of date.

There is also another area where things are out of date, and that is with the ioutil package that's been depreciated in Go. It's now the io or os package. Information about this is given here: https://pkg.go.dev/io/ioutil

Other than those things, this book, in my opinion, is very good. It teaches you the Language in a way you remember; you are not lost and disheartened when something does not work, which I think when starting out with a Language is one of the most important aspects.

I would say this book is very good for Beginners to Go; if you have come from another Language, you may start skimming through the book, which in turn would actually hinder you from finishing it properly and getting the programs working. I guess I am saying that this book is for you if you have basic or no programming knowledge. If you are a seasoned Developer in another language, perhaps choose another book. I think this one is very good for seasoned developers. https://www.gopl.io/

Overall, I enjoyed reading this book; it was easy reading, did not send me to sleep, made me confident in the Go Language, and learned a lot. I highly recommend this book if you can see past its outdated issues.

Top comments (0)