Skip to main content

Programming Pearls

by Jon Bentley

TLDR

  • The first edition of this book is quite old, and the examples and situations do show that a bit. There is acknowledgement of this, but you should be forewarned that the examples are very low-level.
  • While that is true, the book does a good job at helping you to think about problems in a multitude of ways, and proposing all sorts of situations that are LIKE what you commonly run into while designing systems.
  • I think this book has far more value, at least initially, than books that deep dive into algorithms (such as Intro to Algorithms). Learning them at a high level is a great intro to how things wor behind the scenes.
  • DO NOT CODE IN THE STYLE THIS BOOK CODES IN, IT IS NOT CLEAN, OR EVEN CLOSE.

Why?

If you have an interest in being the best coder you can be, you have to have familiarity with algorithms. This is the best introduction to why that is that I have found.

Who should read?

I don't think this book is for everyone necessarily, and in the wrong hands it could actually ENCOURAGE bad habits, but engineers interested in the Code (and maybe Data) path should definitely read this book.

Important Concepts

  • He actually sums it up himself in the epilog:
    • Work on the right problem.
    • Explore the design space of solutions.
    • Look at the data.
    • Use the back of the envelope (best guess).
    • Exploit symmetry.
    • Design with components.
    • Build prototypes.
    • Make tradeoffs when you have to.
    • Keep it simple.
    • Strive for elegance (I don't actually remember this in the book, but it's good advice).