Programming Pearls

%A Jon L. Bentley
%T Programming Pearls, Second Edition
%D 2000
%G ISBN 0-201-65788-0
%I Addison-Wesley, Inc.
%P 239 + xi pp

This book started as a collection of essays published in Bentley's "Programming Pearls" column in Communications of the ACM.

This book is mostly about elegance in programming. How to solve difficult problems using elegant code. Learn how to chose the right algorithms and data structures for the task at hand. The book comes with examples that are carefully selected to reflect real-world programming problems, but without obscuring the intent of the code with too much specific detail.

As you may have guessed I really like this book. Every programmer should read it. Where else can you find a hash table implementation written in 30 lines of C or an insertion sort in 7 lines of straight-forward code? It also includes nice sections on performance tuning, testing, debugging and even on writing assertions as a way towards proving program correctness. Another part that you shouldn't miss is the section on back-of-the-envelope calculations.

I found the second edition worth buying, even for those (like me) that already own the first edition. There are some new chapters and other chapters have been reworked. Most samples used to be in pseudo-code and even Cobol. There still is a lot of pseudo-code, but the book now also includes a lot of C, C++ and VB code. The web site for the book has the actual source code for you to play with.

Related links

See Francis Glassborow's review for the ACCU.

Jon Bentley Receives Dr. Dobb's Excellence in Programming Award.