Book Review: Programming Pearls
I’ve recently started working back through Jon Bentley’s Programming Pearls . I first bought this book back in 2013, when I was first starting to move back to professional software development after over a decade’s hiatus. It came highly recommended by a number of experienced programmers, and even then I could appreciate that this was a very valuable book. That said, I understand now that I lacked the programming maturity to get much out of it. Back when I first read the book, I had forgotten many of those data structures and algorithms I had learned back 15-20 years ago when I first started programming, which to be frank was not many. And I struggled to get much out of Programming Pearls. Despite my many years of hobby-level programming, I simply lacked the programming maturity to appreciate a lot of what he was discussing.
Since that time, I’ve done a methodical review of the most common data structures and algorithms using Sedgewick and Wayne’s Algorithms, among other textbooks and online resources, such as Khan Academy and Hackerrank [2,3,4]. And it’s amazing how much things are now “clicking” as I read Programming Pearls. It’s a great resource for someone with a modest amount of professional programming experience and a basic knowledge of data structures and algorithms. Bentley covers a wide range of topics relevant to the working programmer, including multiple chapters with case studies of algorithmic development from Bentley’s life as a professional developer, a chapter on the importance of choosing the right data structure(s) for your program, program performance/tuning, and finally a number of chapters that discuss specific algorithms and data structures.
However, my favorite chapter of the book by far is a chapter on writing correct programs using invariants (implemented as assertions), particularly loop invariants. I am now convinced of the need to include more analysis of program correctness into my programs using invariants, particularly when dealing with tricky looping algorithms. I wish I could find more material like this chapter, which is sort of applied formal methods. You usually only find these types of techniques only discussed in dry, academic papers.
Do you know of any other books that go into how to write correct programs using invariants or other techniques that can be implemented in common programming languages? Let me know below in the comments!