sports Tools Echo Spot countdown boutiques-francophones Introducing Fire 7 tablet, starting at $59.99 WFM Kindle Paperwhite

Customer reviews

4.1 out of 5 stars
20
Programming Pearls (2nd Edition)
Format: Paperback|Change
Price:$46.03+ Free shipping with Amazon Prime


on March 5, 2016
I find the changes made for the second edition quite perplexing. The original was all about walking through the experiences of a capable programmer as he made deep realizations about the nature of his work. The changes to remove outdated references have made the stories feel synthetic and a bit disjointed in a way that hurts those goals.

Plus there are a number of little perplexing changes.

- The book is printed with a very small margin and wide lines of thin font, which combine to really hurt readability. The original was a much prettier book
- The book added more questions that are in reality just apocryphal stories, rather than removing than removing the perplexing ones already there
- The new segments on things like "using spreadsheets and databases" which became dated immediately in a way none of the original text has

Despite these issues most of the content of the original is still in there somewhere, so I couldn't possibly give it less than 3 stars. However I would implore you not to buy the updated edition unless you really want to see the few bits of new content.
0Comment|Was this review helpful to you? Report abuse
on August 24, 2016
Wow, there are so many simple tricks and detailed explanations. Will surely make you a better programmer, regardless of experience.
0Comment|Was this review helpful to you? Report abuse
on November 28, 2014
Needed for college and Amazon had it.
0Comment|Was this review helpful to you? Report abuse
on May 8, 2015
This book (together with More Programming Pearls) shares #3 in my all time Top 100 Favorite Programming, Computer and Science books:

http://www.catonmat.net/blog/top-100-books-part-one/

Classic programming book. Jon Bentley knows how to write clearly and enthusiastically about algorithms. This book is timeless and it teaches you how to reason about problems, break them apart, and efficiently implement the solutions. You'll pass the Google interview if you read and understand this book.

I just love the way Jon Bentley writes. I don't know what else to say. These two books really teach the basics of solving programming problems. It takes many years to master the basics in practice but these books teach the basics well. I once wrote a blog post (http://www.catonmat.net/blog/three-beautiful-quicksorts/) about Jon Bentley's chapter in Beautiful Code that he based on a chapter on quick sort in Programming Pearls.
0Comment| One person found this helpful. Was this review helpful to you? Report abuse
on June 17, 2000
The thirteen columns in this book appeared in the Communications of the ACM between 1983 and 1985. There can't be more than a couple of technical books on computing from that era that are still worth reading. Kernighan & Ritchie's book, "The C Programming Language", is one that springs to mind; this book is definitely another, and will probably outlast K&R as it has almost no ties to existing or past hardware or languages.
What Bentley does in each of these columns is take some part of the field of programming--something that every one of us will have run into at some point in our work--and dig underneath it to reveal the part of the problem that is permanent; that doesn't change from language to language. The first two parts cover problem definition, algorithms, data structures, program verification, and efficiency (performance, code tuning, space tuning); the third part applies the lessons to example pseudocode, looking at sorting, searching, heaps, and an example spellchecker.
Bentley writes clearly and enthusiastically, and the columns are a pleasure to read. But the reason so many people love this book is not for the style, it's for the substance--you can't read this book and not come away a better programmer. Inefficiency, clumsiness, inelegance and obscurity will offend you just a little more after you've read it.
It's hard to pick a favourite piece, but here's one nice example from the algorithm design column that shows how little the speed of your Pentium matters if you don't know what you're doing. Bentley presents a particular problem (the details don't matter) and multiple different ways to solve it, calculating the relationship between problem size and run time for each algorithm. He gives, among others, a cubic algorithm (run time equal to a constant, C, times the cube of the problem size, N--i.e. t ~ CN^3), and a linear algorithm with constant K (t ~ KN). He then implemented them both: the former in fine-tuned FORTRAN on a Cray-1 supercomputer; the latter in BASIC on a Radio Shack TRS-80. The constant factors were as different as they could be, but with increasing problem size the TRS-80 eventually has to catch up--and it does. He gives a table showing the results: for a problem size of 1000, the Cray takes three seconds to the TRS-80's 20 seconds; but for a problem size of 1,000,000, the TRS-80 takes five and a half hours, whereas the Cray would take 95 years.
The book is informative, entertaining, and will painlessly make you a better programmer. What more can you ask?
0Comment|Was this review helpful to you? Report abuse
on November 30, 2001
This book is timeless because it discusses recurring problem situations with elegance, clarity, and insight. The book is about thinking and problem-solving more than it is about the particular circumstances it discusses.
For instance, the very first chapter ("Cracking the Oyster") would seem to be about the problem of sorting on disk: surely an archaic concern in these days of 1+GB RAM and 100 GB online media on PCs. But that would entirely miss the point, which Bentley clearly summarizes for us in the "principles" section of this chapter:
* "Defining the problem was 90 percent of this battle..."
* Select an appropriate data structure
* Consider multiple-pass algorithms
* A simple design: "a designer knows he has arrived at perfection not when there is no longer anything to add, but when there is no longer anything to take away." -- St. Exupery
This advice might look like a string of old, worn-out chestnuts as set forth above. But within the context of the specific problem, we can see how the design challenges and solutions follow each other, through several iterations, culminating in a pretty solution, nicely illustrating the principles, and suggesting their relevance to other problems, too.
A thoughtful programmer, no matter whether her domain is machine language or OODBMSes, will come away from any chapter in this book full of new ideas and inspiration.
Problems (good ones) after each section encourage the kind of rumination that is necessary to derive the most from this book. Every few years I take it (and its companion, "More Programming Perals") off the shelf and dip into it again, and always come away enlightened.
0Comment| 2 people found this helpful. Was this review helpful to you? Report abuse
on July 27, 2002
Bentley's classic, "Programming Pearls", makes an important point, namely that you won't get good performance without careful coding and profile-based tuning. And it's made clearly, concisely and with compelling examples. The choice of language (C), and the choice of problems (those from computer science 101 we all think we know cold) betrays the sophistication of Bentley's analyses.
Suppose, for the sake of argument, that you have a binary search that's holding up your loop. Or your Huffman coding just isn't snappy enough? "How is that possible?", you might say, fresh out of computer-science 201, "Didn't we just prove these algorithms are optimal?" Well yes, asymptotically up to an arbitrary constant multiplier. But this is the real world, and your code needs to go faster. If this sounds like your predicament, pull up a chair and read "Programming Pearls"; if it's not, you might wonder what all the fuss is about.
Next, fire up your favorite hardware (Sparc or x86 or PowerPC), favorite language (Perl, Java, or even C), favorite release of that language, along with your favorite interpreter or compiler (Hotspot or standard? GCC or Visual C++). And you'll need a profiler; might as well treat yourself to a good one if you're serious. Then fire up your code with a representative range realistic test data and observe what happens. Function by function, byte by byte. Then try to be as clever as Bentley in (a) figuring out why, (b) trying a range of alternatives, and (c) making it all go faster with minor tuning. Typically, you'll find a single bottleneck taking an order of magnitude more time than everything else, and work on that. Repeat until fast enough.
As well as this simple, yet surprisingly effective and realistic methodology, Bentley provides a range of concrete tips on making things go faster, from tweaking data structures to unfolding loops (especially precomputing low-order cases) to using accumulators and caching, all with an eye to underlying memory, communication and CPU resources.
Real code that has to run fast, like the code that we write at my current company for signal processing, speech recognition and speech synthesis, typically looks like the end-product of Bentley's refactorings. And it gets that way following exactly the path he lays out: analyze the problem, choose the right algorithm (or the right few to evaluate), and then tune it up using profiling.
"Programming Pearls" is the beginning of the road. You will need to look elsewhere for topics such as compression for memory saving, numerical algorithms, effective concurrency and memory sharing, efficient buffered I/O, garbage collection, and the wide range of dynamic programming and heuristic techniques.
0Comment| One person found this helpful. Was this review helpful to you? Report abuse
on April 18, 1997
There are not many books on advanced computer programming that you actually want to read. Usually, the subject is so dry and full of theory that you have to force yourself. This book is the exception. Bentley's easy-to-read style makes this book a pleasure to read. His theoretical analysis is impeccable, but he presents complex topics in a chatty format that makes you remember the joy you felt the first time you wrote a program, and lets you know he still feels that way
0Comment|Was this review helpful to you? Report abuse
on December 18, 1999
It's great to see they've come out with an update to this book. The essays in this book are easy to read and touch on many valuable things, such as tuning and optimization of algorithms, using mini languages to provide robust tools, doing back-of-the-envelope calculations, and much more. I have recommended this book to several beginning programmers that I know as an excellent introduction to thinking effectively about the challenges of software engineering.
0Comment|Was this review helpful to you? Report abuse
on September 21, 2001
This book was useful in 1983, when professional programmers were still coding in assembler, and there was a need to get high-performance software into a small space (like 12K!).
But the world has moved on. Performance will always be a key issue, but the performance problems of the modern world typically do NOT lie in the areas which this author is enthusiastic about: the choice of sort algorithms. A lot of software doesn't do any sorting at all, but retrieves records from a relational DB pre-sorted by the SQL statement. (In this world, the DB vendor will be acutely aware of sort performance!)
But software has grown huge since 1983. Various techniques have evolved to handle this hugeness: structured analysis, modular design, and object-oriented techniques most recently. Most professional software engineers spent a LOT more time defining interfaces (and repairing them, or migrating them) then they will ever spend tweaking a sort algorithm.
After all, as the wise old programmer said, if you're only sorting a dozen things (or even two dozen), a bubble sort is the way to go: easy to code, easy to understand, a little slow, but with machines running at 2 gigahertz it all happens in less than a millisecond anyway.
I think you would be much better advised to read "Rapid Development" by Steve McConnell. That book is an excellent overview of modern software engineering issues and practices, and discusses dozens of essential things not even mentioned in this book (source code control, development cycles, release management, coding to requirements, and so on and on and on!)
0Comment|Was this review helpful to you? Report abuse