Programming Pearls (2nd Edition)

  Author:    Jon Bentley
  ISBN:    0201657880
  Sales Rank:    8604
  Published:    1999-09-27
  Publisher:    Addison-Wesley Professional
  # Pages:    256
  Binding:    Paperback
  Avg. Rating:    5.0 based on 33 reviews
  Used Offers:    9 from $27.98
  Amazon Price:    $32.66
  (Data above last updated:  2008-10-25 06:17:43 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
Programming Pearls (2nd Edition)
  
The first edition of Programming Pearls was one of the most influential books I read early in my career, and many of the insights I first encountered in that book stayed with me long after I read it. Jon has done a wonderful job of updating the material. I am very impressed at how fresh the new examples seem." -Steve McConnell

When programmers list their favorite 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.

In this revision, the first in 14 years, Bentley has substantially updated his essays to reflect current programming methods and environments. In addition, there are three new essays on * testing, debugging, and timing * set representations * string problems All the original programs have been rewritten, and an equal amount of new code has been generated. Implementations of all the programs, in C or C++, are now available on the Web.

What remains the same in this new 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 favorites.

Fourteen years after it was first issued, C++ expert Jon Bentley reinvents a true classic with the second edition of his Programming Pearls. Completely revised and brought up to date with all new code examples in C and C++, this book remains an exceptional tutorial for learning to think like a programmer.

The "pearls" in question center not only on choosing the right algorithms (like binary searches, sorting techniques, or sparse arrays) but also on showing how to solve problems effectively. Each chapter frames a particular programming task--such as sorting numbers, creating anagrams, or counting the words in a block of text--many drawn from Bentley's experiences in his long career as a developer. The book traces the process of arriving at a fast, efficient, and accurate solution, along with code profiling to discover what works best. After refining the correct answer, each chapter enumerates programming principles that you can use on your own.

The author also challenges you to think like an engineer, and each chapter ends with about a dozen problems to get you thinking creatively about design issues. (Sidebars on such historical topics as the first computer solutions to computer chess, spell-checking, and even architectural design help create a perspective on successful problem solving and make for a truly educational and enjoyable tour of how to become a better programmer.) Bentley also asks the reader to think analytically about the world with "back of the envelope" estimation techniques drawn from engineering. Appendices list the algorithms and code rules covered in the book, plus some sample solutions.

Fans of the first edition of this title will be pleased to see this favorite computer text brought up to date for today's faster hardware. Whether you want to improve your command of algorithms or test your problem-solving skills, the new version of Programming Pearl is a challenging, instructive, and thoroughly entertaining resource. --Richard Dragan

Topics covered: Programming and problem-solving tutorial, sorting algorithms, merge sort, bit vectors, binary searches, program correctness and testing, improving performance, engineering and problem-solving techniques, performance estimates, designing for safety, divide-and-conquer and scanning algorithms, tuning code, tips for more efficient memory usage, insertion sort, quicksort algorithms, sparse arrays, searching algorithms, binary search trees, heaps, priority queues, searching text, and generating random text.

                  Reader Reviews 1 - 23 of 23                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
10-16-08 5 (NA)
(Hide Review...)  Utterly essential to read and re-read
Reviewer Permalink
I have a (very) short list of books that I re-read annually. This is the book at the top of my list.

I am a professional software developer working within the world's largest software company. I work in amongst (BY FAR) the most incredible software engineers on the planet. One of the things that I enjoy the most about working with the people around me is range and depth of experiences that are applied to solving a given problem. Oftentimes, the best solution is not the most obvious.

That's why I re-read this book every year: it's a short, easy-to-read reminder to think laterally about a given problem and to deconstruct a problem as much as possible before attacking it.

I first read this book back in 2000 whilst stood in a bookstore. I instantly wondered why Jon hadn't written it before.

Creative thinking is something that we all too often forget when we toil daily on our code, trying to make it more feature-complete, faster, more secure and more stable. Sometimes one needs to take a step back from the problem and consider things with a more open mind that may result in having to write less code overall, or to write just a little more code to completely transform the operational performance of a given routine. This book regularly reminds me how to do that.

I cannot recommend this book highly enough - absolutely essential reading for all developers - old and new - regardless of your chosen language / platform / toolset.
(Review Data Last Updated: 2008-10-25 06:20:25 EST)
09-21-08 4 (NA)
(Hide Review...)  Good book
Reviewer Permalink
This book deeply explains each alogirthm and its complexities. Teaches you how each line could affect the performance of the problem. Good thing is it has many exericised that gives more insight of the algorithm discussed.
(Review Data Last Updated: 2008-10-17 08:10:24 EST)
09-19-08 2 (NA)
(Hide Review...)  Brief and cursory
Reviewer Permalink
It's a collection of lessons appropriate for college students, nothing more. If you've seen your fair share of sorts and trees, don't feel pressured by my fellow reviewers into thinking this book is some sort of essential programmers' bible.

The advice so highly praised here is borderline commonsensical: ask why you need to change code before you do it, get as many specification details as you can before you start a project, consider running times and minimizing the amount of data you need to use.

Pearls is short on content for us non-newbies.
(Review Data Last Updated: 2008-09-22 06:28:31 EST)
09-15-08 5 (NA)
(Hide Review...)  Must read
Reviewer Permalink
One of the must read for S/W Engineers. These essays make you really think and teach you basics of s/w development. I also liked the exercises under each essay. I found it difficult to read this book in one go but I read this book almost twice. And every time I read this, I learn something new!
(Review Data Last Updated: 2008-09-19 06:25:07 EST)
06-16-08 5 (NA)
(Hide Review...)  true pearls of programming wisdom
Reviewer Permalink
If this book doesn't get you excited about programming, I don't know what will. Bentley writes about programming problems that are as glamorous as hollywood. The collective wisdom of the Bell labs super-stars shines through in the background information and problems which the author picked.

I went back and read some of the columns from the ACM magazine which this book originated from. The book is definitely more up-to-date and readable.

I cannot over-emphasize the value of trying out the problems in the book without cheating and looking at the answers or hints. Great way to prepare programming interview questions, whether you're an interviewer or interviewee.
(Review Data Last Updated: 2008-09-15 08:16:53 EST)
06-16-08 5 (NA)
(Hide Review...)  pearls of wisdom
Reviewer Permalink
If this book doesn't get you excited about programming, I don't know what will. Bentley writes about programming problems that are as glamorous as hollywood. The collective wisdom of the Bell labs super-stars shines through in this timeless classic.
(Review Data Last Updated: 2008-07-31 06:43:19 EST)
02-08-08 2 0\9
(Hide Review...)  For Absolute Beginner Programmers
Reviewer Permalink
This book is really addressed towards absolute beginner programmers. Maybe if you've only taken an introductory course or two at college, or just have the syntax of one language under your belt and want a broader perspective this book will be useful.

If you have any experience, the examples are all very mundane. (E.g. "this is what a minheap is"). If you have just finished reading a "Learn [Language] in 24 hours!" type book, I guess this wouldn't be a bad follow up. Otherwise, steer clear.
(Review Data Last Updated: 2008-05-18 05:10:02 EST)
11-04-06 5 1\3
(Hide Review...)  A must for everyone serious about software engineering
Reviewer Permalink
great book. guaranteed to transform you into a better and more professional software engineer
(Review Data Last Updated: 2008-03-08 07:34:41 EST)
11-03-06 5 (NA)
(Hide Review...)  A must for everyone serious about software engineering
Reviewer Permalink
great book. guaranteed to transform you into a better and more professional software engineer
(Review Data Last Updated: 2007-02-24 18:09:39 EST)
09-09-06 5 1\4
(Hide Review...)  a must
Reviewer Permalink
Read this book, the sooner the better! This IS the Computer Science as it's supposed to be in the same row with Knuth and Sedgewick.
(Review Data Last Updated: 2007-07-06 17:55:13 EST)
03-18-06 5 5\6
(Hide Review...)  Programming insight
Reviewer Permalink
Derived from a popular series of columns from the ACM flagship magazine (Communications of the ACM), this book takes you as near as possible to a professional programmer's way of thinking.

Each chapter walks through the internal process a programmer follows to solve particular problems (and teaches newcomers how some techniques should be used in practice).

If you read only one book on computer programming apart from your language handbook (something I would never recommend), this should be the one.

PS: Plauger's "Programming on Purpose: Essays on Software Design" would probably be my second choice.
(Review Data Last Updated: 2007-07-06 17:55:13 EST)
03-17-06 5 1\1
(Hide Review...)  Programming insight
Reviewer Permalink
Derived from a popular series of columns from the ACM flagship magazine (Communications of the ACM), this book takes you as near as possible to a professional programmer's way of thinking.

Each chapter walks through the internal process a programmer follows to solve particular problems (and teaches newcomers how some techniques should be used in practice).

If you read only one book on computer programming apart from your language handbook (something I would never recommend), this should be the one.

PS: Plauger's "Programming on Purpose: Essays on Software Design" would probably be my second choice.
(Review Data Last Updated: 2006-06-07 16:54:08 EST)
01-05-06 4 4\6
(Hide Review...)  Great book for some programmers
Reviewer Permalink
I liked this book, but it is somewhat limited in its scope. I'm a software engineer, and this book doesn't offer tips on designing software. However, it is phenomenal for code tuning and improving programming style and logic. The experienced coder will not be disappointed with this book in his/her library. Even the new coder can learn valuable tips from this.
(Review Data Last Updated: 2007-07-06 17:55:13 EST)
01-04-06 4 2\2
(Hide Review...)  Great book for some programmers
Reviewer Permalink
I liked this book, but it is somewhat limited in its scope. I'm a software engineer, and this book doesn't offer tips on designing software. However, it is phenomenal for code tuning and improving programming style and logic. The experienced coder will not be disappointed with this book in his/her library. Even the new coder can learn valuable tips from this.
(Review Data Last Updated: 2006-06-07 16:54:08 EST)
12-29-05 2 9\20
(Hide Review...)  Not For Beginners...
Reviewer Permalink
- Bentley's 'Programming Pearls' offers many programming techniques and design principles.
- But the text assumes that the reader is *extremely* familiar with C-style syntax and many advanced computer science concepts.

While Bentley emphasizes important fundamentals, his language is rather esoteric.

I bought this book because Steve McConnell ('Code Complete' author) recommends it for 'beginner' developers at his company (Construx Software); but I encourage 'beginner' developers (and even senior developers) to look elsewhere.

This book is meant for computer science graduate students. It incorporates more advanced math and more advanced computer science techniques than the average software developer will ever encounter.

Most of 'Programming Pearls' was penned before the widespread use of object-oriented programming; so Bentley heavily emphasizes code tuning. In today's world, most .NET and J2EE developers are likely to find greater efficiencies within their architectural design.

- Developers who need to either learn or revisit important fundamentals should read Steve McConnell's 'Code Complete'.
(Review Data Last Updated: 2007-07-06 17:55:13 EST)
11-07-04 5 1\2
(Hide Review...)  Must have (even if you are experienced).
Reviewer Permalink
Programming Pearls is one of the very few books that looks at the problems that we as programmers all have, and keep on having day in and day out. It strives for solutions to problems that are compact, efficient and fast. It questions thinking and makes you think about programming.

The book is comprised of a series of articles focused on a topic which you can read in any order you like. This is one of my favorite programming books, as I always find something 'new' just by browsing it. Unlike some other books on similar topics, the delivery of the information is concise and pallatable. I love this book.
(Review Data Last Updated: 2007-07-06 17:55:13 EST)
08-20-04 5 1\1
(Hide Review...)  Great mental warm-up
Reviewer Permalink
With tight schedules it is often easy to forget to ask the question "Why do you want this?" If you help other coders solve problems like I do, you are often approached with a solution that "needs to go faster." This book has paid for itself with just the fact it reminds me to ask this question.

If you are a very experienced programmer you probably won't find much new, but you might find lending it to other people allows you to get more done. Teach a person to fish...
(Review Data Last Updated: 2006-06-07 16:54:08 EST)
08-19-04 4 3\3
(Hide Review...)  Makes you think harder
Reviewer Permalink
Programming pearls is a compendium of 15 columns previously published in Communications of the ACM. The columns cover a wide range of topics related to programming: from requirements gathering to performance tuning. The focus is primarily on coding techniques and algorithms.

Each column has been reorganized as a chapter. Chapters usually start with the presentation of a practical problem. Then various solutions are presented and are used as lessons to be learned. The writing style is clear and fun.

Programming Pearls is not a usual book teaching new programming concepts. Although it contains good and sometimes quite novel ideas, the aim of the book is not to teach something new. For example, the search and sort algorithms presented are well-known. The aim is to remind programmers to think hard before starting writing code. The book has great chapter on back-of-the-envelope computation for example which is useful when comparing various solutions. The easy solutions to the column's problems are usually very slow. The `good' solutions are lightening fast but require thinking hard about the problems. I would recommend having a book about algorithms nearby when reading Programming Pearls.

The book is full of little (and some not so little) exercises that are given throughout the chapters. Solutions or hints are given at the end. The exercises usually take a few hours to do properly and are a great resource. Again the emphasis is on making the reader think.

If you consider programming a repetitious activity, Programming Pearls will provoke you into thinking harder about finding elegant solutions. I recommend this book.
(Review Data Last Updated: 2006-06-07 16:54:08 EST)
04-25-04 4 2\3
(Hide Review...)  Back to Basics... Still a Valuable Book
Reviewer Permalink
I bought the 2nd edition of the book.
This book takes you to the Basics of Programming: Problem definition, Algorithm design , choosing the correct data structures, Assertions, Performance considerations during Design and coding, Code Tuning, Squeezing the space.

Though the examples are mainly based on searching and sorting and other primitive programming problems, the fundamental concepts and conclusions at the end of each column, are still valuable and hold true as they are 2 decades ago.

The examples and the exercises are challenging and enjoyable. But, don't expect things related to modern programming like related to High Level Programming languages or Databases, this is purely a Basics book focussing on techniques of solving the problems the simplest and the best way.

Some of the gem quotes or conclusions from the book are:

"Coding skill is just one small part of writing correct programs. The majority of the task is problem definition, algorithm design and data structure selection."

"Defining the problem is about ninety percent of the battle"

Characteristics of a good Aircraft(or a good program) - "Simple, few parts, easy to maintain, very strong"

"A designer knows he has arrived perfection not when there is no longer anything to add, but when there is no longer anything to takeaway."

"Good programmers sit back and wait for an insight rather than rushing forward with their first idea"

"A proper view of data does indeed structure programs. Before writing code good programmers thoroughly understand the input, the output and the intermediate data structures around"

(Review Data Last Updated: 2006-06-07 16:54:08 EST)
12-24-03 5 0\1
(Hide Review...)  Wow!
Reviewer Permalink
This book is amazing! Its a true classic on algorithims.

I would place this on my list of the top 5 programming books of all time. A must read for every who calls themselves a "programmer".

(Review Data Last Updated: 2006-06-07 16:54:08 EST)
09-23-02 3 14\52
(Hide Review...)  If you're at all experienced, seek other reading.
Reviewer Permalink
I only have 2 years of programming experience. I read an awful lot of programming texts. Right now I have 10 books just on C itself. Not to mention all the java and C++ books... My point to saying this is, if you've already read as many books as I have, this book will do nothing for you. I read this book over the weekend and was just astonished with how simple minded it all was. I constantly said "Duh..." throughout the entire book. The pseudo code in this book was the worst I've ever seen. I have never returned a book before except for "Linux Socket Programming". I returned this one today.

The reason I did give this book 3 stars was because I can see it being extremely great for uneducated newbies. It will teach them a great deal and have them think about efficiency and general good programming practices.

I was amazed at all of the great reviews I saw with this book. Everyone that gave a review must of been new to computer programming. I was personally expecting a few more advanced topics such as real C and C++ code. Not the .... pseudo code that this author insisted on using.

Overall, this is a great book for neophytes. If you're new to programming, get this book and give it a good once over. Don't pay attention to his style though... As he stated in the book, it's due to the constraints on space and the fact he didn't want to write a 1200 page book. However, if you have gotten to the point where you've studied advanced data structures and algorithms and know what a linked list is and a binary tree and you understand the concepts behind a heap, priority queues and such, I'd go for another book that is going to advance your knowledge, not bring it back a step.

(Review Data Last Updated: 2006-06-07 16:54:08 EST)
09-12-02 3 4\22
(Hide Review...)  Book of stories
Reviewer Permalink
The book wa interesting to me as the collection of stories about programming and problems that programer can meet in his work. the solutions in the book are brilliant.

On the other hand, I don't lik that book treats some very specific problem areas, which are unconnecet mutually. Secondly, there are many things in this book which are completely out of date. I don't want to say that they are completely unimportant, but there are things in modern programming that are much more important and in wich you can improve your program much more.

I read this book, as I said before, as collection of funny and interesting stories.

(Review Data Last Updated: 2006-06-07 16:54:08 EST)
07-27-02 5 14\18
(Hide Review...)  The how-to for profile-based tuning
Reviewer Permalink
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.

(Review Data Last Updated: 2006-03-06 11:51:12 EST)
  
                  Reader Reviews 1 - 23 of 23                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated
All Books Arts Biography Click Here For An A-Z Index Of All 213 Best-Seller Subjects Business Children's Comics
Computers Cooking Engineering Entertainment Health History Home Horror Humor Law Fiction Medicine Mystery
Nonfiction Outdoors Parenting Professional Reference Religion Romance Science Sci-Fi Sports Teens Travel
In Association with Amazon.com

Cache miss
(not cached)