Reviews

The Practice of Programming by Brian W. Kernighan, Rob Pike

thirtytwobirds's review against another edition

Go to review page

3.0

Overall: a decent introduction to some of the lessons you'll learn after a few years in the trenches of real programming.

If you're fresh out of college and starting your first programming gig, read this book carefully. A lot of what it says may sound like common sense, but often people don't take it to heart. It will save you pain down the road. Kernighan and Pike know what you're talking about and you'd be wise to listen to them.

If you're already an experienced programmer there's probably not a whole lot here that will be new to you, but it's still worth reading to see how the authors talk about things. And who knows, there may be a lesson or two in it for you after all!

The book is *very* C and C++ focused, with occasional examples in Java, shell and Perl. A lot of the advice in it is specific to C, so if you're not a C programmer you can skim over some of the examples. But the lessons learned from the examples often translate to higher-level languages, so don't skip them entirely!

Oh, and if you're a Lisp programmer you'll want to skip the "Generating Code Using [C] Macros" section unless you have a strong stomach.

shayneh's review against another edition

Go to review page

3.0

Still applies, twenty years later. Good advice here, though some examples sound dated.

erikars's review against another edition

Go to review page

A vaguely amusing bunch of stuff I knew already. The chapters and debugging and testing were probably healthy to read though.

crypticmeg's review against another edition

Go to review page

informative reflective medium-paced

3.0

reality's review

Go to review page

4.0

Bit dry, good information

muscar's review against another edition

Go to review page

3.0

Jan 2021: While reading TPoP I discovered "Writing Solid Code" (https://www.goodreads.com/book/show/598624.Writing_Solid_Code). Both books covers 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. But its focus on simplicity is its main downside as well. The solutions end up simplistic, not just simple.

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 point 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 are some solid tips 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.

izakaya's review

Go to review page

3.0

Some interesting material, but overall more suited to people at the start of their careers, and very focused on low-level concerns that are relevant for C and C++. Actually, my overriding impression during the book was "look at all this effort to avoid dumb errors in low-level programming languages; I need to never use C again."
More...