Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
The Go programming language
Donovan A., Kernighan B., Addison-Wesley Professional, Old Tappan, NJ, 2016. 400 pp. Type: Book (978-0-134190-44-0)
Date Reviewed: Jan 22 2016

In 1978, Brian Kernighan and Dennis Ritchie published The C programming language [1], the first book about C and the definitive guide to the language for decades. Kernighan has now teamed up with Alan Donovan to write The Go programming language, which, while not the first book about Go, is likely to play the same role for Go as its predecessor did for C.

The two books are similar in more ways than just their titles. Like the C book, the first chapter of the Go book is a tutorial survey of the language that covers its main features, gives a flavor of the language, and shows off some of its capabilities. The chapters that follow in both books focus on particular aspects of the languages. In the Go book, these chapters discuss program structure, basic data types, composite types, functions, methods, interfaces, goroutines and channels, concurrency with shared variables, packages and the Go tool, testing, reflection, and low-level programming. The C book has a C reference manual as its appendix; the Go reference manual is online (https://golang.org/). Both books have extensive indices. Both books also have many code examples--in fact, many examples from the C book reappear in the Go book--and exercises at the ends of some sections. Even the cover, typography, and overall design of the Go book echo the C book.

The similarity of these books seems meant to suggest that Go is a modern replacement for C. Go was developed by a team at Google whose core is Rob Pike, Ken Thompson, and Robert Griesemer (and it now includes Donovan). Thompson and Pike, along with Kernighan, were part of the group at Bell Labs that developed Unix and C and promulgated an approach to software development based on the tools and languages in that environment. This philosophy emphasized simplicity and parsimony, and that sensibility is evident in the design of Go. Go is a small language that offers much of the power of large modern languages like Java and C++ without the complexity that comes with size. In many ways, it is a reaction to the complex type systems of object-oriented languages with parametric polymorphism (that is, generics or templates). On the other hand, Go incorporates the lessons learned and the changes in computing since C was invented: it is strongly typed and has a rich type system, interfaces (but no classes), pointers (but no pointer arithmetic), garbage collection, packages, reflection, and concurrency modeled on Hoare’s communicating sequential processes (CSP). Go also comes with a toolset that supports testing, benchmarking, profiling, code formatting and refactoring, and builds without makefiles. Go takes its operators and control structures from C; its packages, type declarations, and methods from Oberon; and its concurrency constructs from Newsqueak. It is thus a C-like language superficially, but incorporates many features from other languages. Also like C, it can be used for both systems programming and more general-purpose development. In summary, the book makes the case that Go is a simple, powerful language suitable for systems programming whose design reflects what we have learned about programming languages design since the 1970s, and is thus a suitable replacement for C.

Despite the similarities between the C and Go books, there are many differences as well. The C book (second edition) has 274 pages, but the Go book is a dense 380. Although Go is a small language, it is sophisticated and subtle, requiring considerable explanation and examples. Furthermore, Go has a greater variety of features than C, such as concurrency, reflection, and packages, which require explanation. Finally, Go comes with a sophisticated toolset that must be explained to take full advantage of the language.

Although the Go book and the C book use some of the same examples, the Go book features examples using things not available in 1978, such as the web, scalable vector graphics (SVG), JSON parsers, and Extensible Markup Language (XML) processors. These examples are interesting and demonstrate the capabilities of both the language and its libraries. Reference materials about the language and its packages (and of course the languages itself) are available online (https://golang.org/), and the book assumes this environment. The book also takes advantage of the web by providing all of its examples in a GitHub repository that can be downloaded (in one line) using the Go tool.

Again like its predecessor, this book is written for experienced programmers. For example, there is no section about Go control structures: the reader is presented with examples and expected to recognize common control structures like for loops and conditionals. Differences from standard C control structures are discussed as they come up throughout the book.

One of the strongest features of the book is its frequent discussion of Go idioms and language design decisions. This material is valuable even to someone who already knows Go, because it is the only way (short of poring over Go source code) to become truly proficient in the language. The book is also very strong in considering (almost) all features of the language precisely and in detail. Although the language specification is online, it is invaluable to have extensive discussion and examples of puzzling features.

There are several other Go language books on the market. The completeness of coverage, level of detail, richness of examples, elegance of exposition, and the authors’ intimate knowledge of the language make this book stand out from the rest as the definitive guide to the Go programming language. If you are interested in Go, this is the most important book to own.

More reviews about this item: Amazon, Goodreads

Reviewer:  Christopher Fox Review #: CR144119 (1604-0235)
1) Kernighan, B.; Ritchie, D. The C programming language. Prentice-Hall, Englewood Cliffs, NJ, 1978.
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Concurrent, Distributed, And Parallel Languages (D.3.2 ... )
 
 
Concurrent Programming Structures (D.3.3 ... )
 
 
Parallelism And Concurrency (F.1.2 ... )
 
 
Language Constructs and Features (D.3.3 )
 
Would you recommend this review?
yes
no
Other reviews under "Concurrent, Distributed, And Parallel Languages": Date
Parallel programming
Coffin M., Silicon Press, Summit, NJ, 1992. Type: Book (9780929306131)
Apr 1 1993
Tutorial: compiling concurrent languages for sequential processors
Edwards S. ACM Transactions on Design Automation of Electronic Systems 8(2): 141-187, 2003. Type: Article
Jul 18 2003
Compositional parallel programming languages
Foster I. ACM Transactions on Programming Languages and Systems 18(4): 454-476, 1996. Type: Article
Jan 1 1997
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy