Back

Programmimg Pearls (1985)

65 points2 daysdl.acm.org
tkhattra8 hours ago

bentley revised and updated some of his "programming pearls" columns and published them in 2 editions of books published circa 1986 and 2000. they are among my favorite computer science books, and a great companion to more theoretical data structures, algorithms, and software engineering texts. a great mix of theory, engineering, rules of thumb, insight, creativity etc., all presented lucidly. highly recommended!

vram227 hours ago

Yes, those two books are Programming Pearls and More Programming Pearls. I have both, and they are good. In one of them there is a section or chapter with a few examples of advanced uses of awk, involving awk's associative arrays, to do some non-trivial work in very few lines of code[1]. He shows or says that the equivalent programs in C would be much longer and harder to write.

[1] Even more so than in most other common examples where awk programs are shorter than those in other languages.

biryani_chicken5 hours ago

It's also in archive.org [0] with better quality and several formats for download.

[0] https://archive.org/details/ProgrammingPearls2ndEditionJonBe...

tkhattra1 hour ago

i don't think that's the text of the entire book - it looks like a scrape of the book's former website (www.programmingpearls.com).

satyanash6 hours ago

> Allocate four digits for the year part of the date: a new millenium is coming -- David Martin, Norristown Pennsylvania

2038 is 15 years away right now; this article was published 15 years before 2000.

bombcar6 hours ago

Even in 1985 you could foresee wanting to reference something after 2000 - terms for a thirty year loan, for example.

Harder to see reasons past 2038 back in 1970.

nerdponx4 hours ago

> Harder to see reasons past 2038 back in 1970

I still find myself confused at this one. Did people in 1970s not imagine that any particular program or database would "survive" for 30+ years? Was the expectation that programs written in the future could set the epoch to a later date?

Now that I think about it, I also find it interesting that the epoch date isn't configurable in any system that I'm aware of.

p_l3 hours ago

Nobody expected Unix timestamp to survive so long when it was designed, and norm was to use different format in databases that would care about dates beyond 2038

bombcar2 hours ago

And memory was very precious. Why waste bits that would always be zero?

gregfjohnson4 hours ago

If this is the first time you’ve heard of Jon Bentley’s “Bumper sticker computer science”, you are in for a rare treat! It is a combination of the hilarious and the deeply insightful. An absolute joy, and a must-read for computer scientists and programmers. It is a distillation of aphorisms and wisdom from an entire generation of many of the world’s best minds in our discipline.

embit4 hours ago

John B. on quick sort. Just awesome explanation

https://m.youtube.com/watch?v=QvgYAQzg1z8

fernly7 hours ago

What a user-hostile web page that is. With the "eyelid" banner that keeps trying to close, and the tiny blurred type, and no visible way to continue to the next page, and the usable text linked by buttons above the text, buttons that are quickly hidden from view by the "eyelid" if you scroll far enough to start reading the blurred text... a disaster. ACM should be ashamed.

IlliOnato6 hours ago

I thought there was only one page... how one gets to the next one?

fernly6 hours ago

Get the PDF or etext -- from the buttons that are hard to find.

watersb6 hours ago

A series of exercises from 1970s, so exercises tend to be good Perl or Bash one-liners these days.

But! The real point of this book is How to Ask Questions.

Anyone who has written an entire AI-based inference engine, when the customer wanted a spreadsheet, will get a kick out of this.

And those of us who haven't (yet) will gain some insight that might prove useful later on.

macintux8 hours ago

I thought the title here had a typo, but no, indeed, the typo is at the ACM website (but not the paper itself).

Some choice tidbits in there.

> The job’s not over until the paperwork’s done.

eimrine2 hours ago

Why to avoid asymmetry?

edent54 minutes ago

I was wondering about that. I think it is about having the ability to go A->B without being able to go B->A.

But, as with many of the Pearls, it is heavily context dependent. And if you aren't well versed in "primitive" computing paradigms, you'll be confused.