[x^2 for x in lst]

The Go Programming Language

Author: Alan A. A. Donovan, Brian W. Kernighan

Review created: 2018-09-16

The Go Programming Language is a thorough introduction to programming in Go. It is a book for the working programmer (or hobbyist), not for a total beginner. It assumes that you know what a pointer is, what floating point numbers and arrays are and so forth.

The book discusses all the basic stuff that you need to get started with programming in Go: datatypes (both scalars and composite ones), loops, functions and branching statements. It also describes how Go's variant of OO programming works by discussing interfaces and methods.

Two chapters are devoted to describing how concurrent programming works in Go using goroutines and different kinds of syncronization primitives.

Other topics that are discussed are the tooling included in the Go SDK, how to write unit tests, reflection and the unsafe package, which include functionality to let Go programs interact with programs written in C,

Almost all "minor version" sections (e.g. 7.2) in the book ends with a number of exercises. I did not do any of those, because I was doing the ones in the Exercises for Programmers book while I was reading The Go Programming language, but I think it is really good to have exercises that one can implement if one wishes. I always have a hard time coming up with ideas for programs to write when learning a new language.

That Kernighan is an academic with a really strong Unix background shines through in the book. Many of the examples in the book concerns stuff that I consider to be a little more to the academic side of the programming spectrum. Not to say that they are bad, quite the contrary, but they are not the easiest one to follow. You must pay attention to the book's content and concentrate to be able to grasp the examples. If you do that, you'll find the examples very useful.

Summary: The Go Programming language is a really good book. I read it as my second Go book, Introducing Go being the first one, and I think that this was optimal. I had some brief knowledge about many of the concepts in Go and The Go Programming language filled in the details.

If you are profficient in another programming language, I highly recommend that you use this book to learn Go. If you are a total beginner: choose another book.