HN Books @HNBooksMonth

The best books of Hacker News.

Hacker News Comments on
Programming Pearls

Jon Bentley · 16 HN comments
HN Books has aggregated all Hacker News stories and comments that mention "Programming Pearls" by Jon Bentley.
View on Amazon [↗]
HN Books may receive an affiliate commission when you make purchases on sites after clicking through links on this page.
Amazon Summary
When programmers list their favourite books, Jon Bentley’s collection of programming pearls is commonly included among the classics. Just as natural pearls grow from grains of sand that irritate oysters, programming pearls have grown from real problems that have irritated real programmers. With origins beyond solid engineering, in the realm of insight and creativity, Bentley’s pearls offer unique and clever solutions to those nagging problems. Illustrated by programs designed as much for fun as for instruction, the book is filled with lucid and witty descriptions of practical programming techniques and fundamental design principles. It is not at all surprising that Programming Pearls has been so highly valued by programmers at every level of experience. What remains the same in this edition is Bentley’s focus on the hard core of programming problems and his delivery of workable solutions to those problems. Whether you are new to Bentley’s classic or are revisiting his work for some fresh insight, the book is sure to make your own list of favourites.
HN Books Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this book.
It might be a bit too archaic now, as a lot of the terms and technologies discussed were on the way out even when the last printed version was published, but I did find The New Hacker's Dictionary very enjoyable in this sense.

Programming Pearls might be another good book that promotes enjoyment of computing; certainly a bit more technical, but I think plenty readable for someone interested.

Recommended resources to consider:

* Code Complete

* Programming Pearls

* Pragmatic Programmer

One more I missed regarding review of architecture, code structure/design of OSS: The Architecture of Open Source Applications (Vol 1 & 2)
Available for on-line reading at
Take heart. The interview process is designed to say no. A common anecdote at Google goes like this: "I persuaded the best programmer I know to apply at Google. And we rejected him." These companies say no to all kinds of talented people every day.

Apply again next time you are looking for a job, if Amazon and Google really are the sort of companies you want to work for.

Think back on your interviews and figure out what you did wrong, then study up on that.

And next time, prepare very carefully, with a focus on algorithms and data structures. I would use this book, although it's a bit dated now:

This one may also be useful:

I joke that the only people who pass Google interviews are the people who already work there.
nah, repeat interviews after one year and >80% of already employed there would get rejected

The classic Programming Pearls is not exactly a book of problems, but a book of ideas.

You can probably examine a few of the ideas and play with them like toys. Toys are more fun than problems.

I can recommend "Programming Pearls":

It hasn't a lot of algorithms per se, but it has a lot of examples of how a different view on a problem can lead to an easier/more performant solution. It also does a good job at explaining tradeoffs. I think it's great for people that have had some basic introduction already.

[Ref link if anyone feels like it:]

For those of you who aren't familiar with the author's other works, it's worth taking a peek at his other books.

I can whole heatedly recommend Pearls of Functional Algorithm Design

It's a good cross between two other excellent books:

- Jon Bentley's Programming Pearls


- Chris Okasaki's Purely Function Data Structures

If you haven't read all three, its well worth your while to do so!

And of course if you are going down the rabbit hole of reading Perls of Functional Algorithm Design then you need to read the "how to read Pearls of Functional Algorithm design" as well.

Seconded! Also, I'd highly recommend "Introduction to Functional Programming using Haskell" by the same author. This was the book that set me forth on the path of FP during post graduation. Though, professionally, I've been programming in Java for close to a decade now most of the FP principals have held me in good stead.

[edit] Preface says "The present book is a completely rewritten version of the second edition of my Introduction to Functional Programming using Haskel" so my recommendation is moot.

Try Skiena's "Algorithm Design Manual" [0]. Another nice book would be "Programming Pearls" [1].

[0] [1]

There are a number of programming books that I use to prepare for technical interviews. These are

1. Programming pearls,

2. Effective C++,

3. Programming Problems,

The reason for these texts is not because they are overtly insightful or well written, it is because they have a large number of problems with completely coded solutions. After working through these basics, programming interviews are much more enjoyable.

In fairness, Programming Pearls is a fairly well known, well regarded book-

If you have time, get Programming Pearls by Jon Bentley (
Although a great book, I don't think there is enough material covered to prepare one for a tech interview.
This isn't the only prep that you'd need, but this is a good one to get your mind in the right place.

(I've given ~2 "big tech" interviews a week pretty solid for the past 6 years)

Programming Pearls is another excellent book in this realm.

Programming Pearls is excellent, but it has very little in common with Hacker's Delight, except that both are excellent books about programming. HD is specifically about the kinds of low-level tricks we're talking about here, while PP generally is not.
Jun 08, 2011 · Revisor on Divine By Zero
Thank you for your answers. To add something myself, the book Programming Pearls contains exactly this - short, elegant solutions, plus some extra food for thought and exercises.

Solutions in Programming Pearls. Each solution is iteratively improved with the proper reasoning.

The bibliography link in the original article was unfortunately broken.

Bentley is also well known for his book "Programming Pearls." The 2nd edition is still in print.

HN Books is an independent project and is not operated by Y Combinator or
~ [email protected]
;laksdfhjdhksalkfj more things ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.