Back
Robert Kirkland Kernighan, Rob Pike: The Practice of Programming (Addison-Wesley Professional Computing Series) (1999, Addison-Wesley Professional) 4 stars

A compendium of practical matters of importance to working programmers.

Review of 'The Practice of Programming (Addison-Wesley Professional Computing Series)' on 'Goodreads'

4 stars

Jan 2021: While reading TPoP I discovered "Writing Solid Code" (www.goodreads.com/book/show/598624.Writing_Solid_Code). Both books cover writing professional quality code in C, but they are quite different.

TPoP claims it'll teach you how to write good (C) code. What it actually does is teach you how to write C code that's good by Unix standards. That's not to say it's a bad book. The advice on debugging is good, and the whole book is a manifesto for aggressive simplicity, which is important, especially these days.

If you're considering reading this book, but don't have a lot of time, give "Writing Solid Code" a go. You'll get more bang for your buck with it.

Original review: This one's been on my reading list for ages. Like the AWK book, it's a mixed bag--what is it with Kernighan's books? On one hand, this is a very approachable, no nonsense book. You won't find philosophical musings here, just straight up (and mostly sensible) programming advice. On the other hand, as other reviewers pointed out, I'm not really sure who this book is meant for.

The first two chapters are a very C centric style guide and a spotty intro to algorithms and data structures. The most notable thing about the algorithms chapter is probably that it includes the buggy version of binary search, so readers beware. Where the book gets interesting is in the final chapters, the ones about debugging, performance and tools. There is some solid advice there that you can see come from real world experience. Even so, the chapters are very brief, so they only scratch the surface on some topics, especially in the last chapter, the one about tools and little languages. And to top it off this is all very C focused--not surprising given its authors and their background.

So is this book worth reading? Yes, but feel free to skim the first few chapters, and focus on the second half of the book. If you do all the exercises (which I admit I didn't), you'll gain quite a lot from reading it. And if there's one thing I took away from this book, it's that you should be relentless in keeping your programs simple and clear.