Vous voulez voir cette page en français ? Cliquez ici.


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions [Paperback]

Herb Sutter
4.7 out of 5 stars  See all reviews (9 customer reviews)
List Price: CDN$ 51.99
Price: CDN$ 32.75 & FREE Shipping. Details
You Save: CDN$ 19.24 (37%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 1 left in stock (more on the way).
Ships from and sold by Amazon.ca. Gift-wrap available.
Want it delivered Friday, October 3? Choose One-Day Shipping at checkout.

Formats

Amazon Price New from Used from
Paperback CDN $32.75  
Save Up to 90% on Textbooks
Hit the books in Amazon.ca's Textbook Store and save up to 90% on used textbooks and 35% on new textbooks. Learn more.
Join Amazon Student in Canada


Book Description

Dec 17 2001 9780201704341 978-0201704341 1
The C++ guru is back -- with even more of the puzzles that have helped thousands of C++ programmers sharpen their skills!
40 programming puzzles designed to illuminate powerful C++ features, techniques, and design principles.
Contains extensive new coverage of the STL and generic programming.
Optimization, multiple inheritance, exception safety, generic programming, memory management, and more. More Exceptional C++ continues where Herb Sutters best-selling Exceptional C++ left off, delivering 40 puzzles that illuminate the most challenging -- and most powerful -- aspects of C++. More Exceptional C++ offers many new puzzles focused on generic programming and the C++ Standard Template Library, including important techniques such as traits and predicates, as well as key considerations in using standard containers and algorithms -- many of them never covered elsewhere. More Exceptional C++ contains a detailed new section (and two appendices) on optimization in single- and multithreaded environments. It also provides important new insights on crucial topics first introduced in Exceptional C++, including exception safety, generic programming, and memory management. For all C++ programmers.
Herb Sutter is an independent consultant, secretary of the ISO/ANSI C++ standards committee, and an invited speaker at technical conferences throughout the world. He is author of the popular Guru of the Week puzzles read by thousands of programmers on the Internet newsgroup comp.lang.c++.moderated. He brought together many of these puzzles in his previous best-seller, Exceptional C++. Sutter is also a columnist for C/C++ Users Journal, and a member of its editorial board.

Special Offers and Product Promotions

  • Join Amazon Student in Canada


Frequently Bought Together

More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions + Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions + Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
Price For All Three: CDN$ 98.25

Some of these items ship sooner than the others.


Customers Who Bought This Item Also Bought


Product Details


Product Description

From Amazon

Aimed at advanced C++ developers who want to hone their programming chops even further, Herb Sutter's More Exceptional C++ borrows the format of his earlier title, Exceptional C++, and delivers some of today's best available thinking on the language in a handy and effective format. A compilation of the author's own experience and research on the thornier aspects of C++, this book will serve as a worthy resource for making sure you get the most out of this powerful language.

The concise text covers a range of challenging topics in C++ without attempting to be comprehensive. Each "item" is presented as a question for you to try and solve by yourself before the author presents his solution, plus additional detail as needed. For most topics, Sutter ends by giving his advice on the best practices (and gotcha's to avoid).

Early sections concentrate on using Standard Template Library (STL) container classes, such as removing items effectively, and the subtle differences between container types. Standout sections on designing custom templates (using specialisation techniques) and designing exception-safe classes will help you do more with your own classes. One entertaining problem here shows a number-guessing game (Mastermind) built as efficiently as possible using STL code (including expert-level use of generic functions to do much of the work).

Several problems on copy-on-write (COW) semantics for more efficient classes point out the issues surrounding code optimisation. (The author argues against a simplistic approach to optimising code, including an over-reliance on inlining functions. Several times, he points out the difficulty of getting COW code to work in multi-threaded projects.)

There has been a debate in the C++ community for years on whether it's possible to design truly "exception-safe" classes. Sutter points out the difficulty with a precise analysis of the issues surrounding exceptions and C++ constructors. Material on the finer points of inheriting classes (including when to avoid and when to use multiple inheritance in C++) will extend your class design options. A good section here is the author's explication of how to simulate COM/Java style interfaces in C++, which isn't immediately obvious, even to experienced C++ developers.

Later sections delve into code-maintenance issues, including advice for using macros, typedefs and namespaces. (Advice on migrating existing C++ code into namespaces will help you combine legacy code with other libraries.) A final appendix shows off some benchmarks for optimising strings using a variety of techniques.

Intelligent, provocative and demanding, More Exceptional C++ shows off why C++ continues to be a rich, complex and challenging language. Armed with titles such as this one, experienced C++ programmers can write better code and avoid pitfalls buried in the outer edges of their favourite language. --Richard Dragan

From the Inside Flap

The Greek philosopher Socrates taught by asking his students questions--questions designed to guide them and help them draw conclusions from what they already knew, and to show them how the things they were learning related to each other and to their existing knowledge. This method has become so famous that we now call it the "Socratic method." From our point of view as students, Socrates' approach involves us, makes us think, and helps us relate and apply what we already know to new information.

This book takes a page from Socrates, as did its predecessor, Exceptional C++ Sutter00. It assumes you're involved in some aspect of writing production C++ software today, and uses a question-answer format to teach you how to make effective use of standard C++ and its standard library with a particular focus on sound software engineering in modern C++. Many of the problems are drawn directly from experiences I and others have encountered while working with production C++ code. The goal of the questions is to help you draw conclusions from things you already know as well as things you've just learned, and to show how they interrelate. The puzzles will show how to reason about C++ design and programming issues--some of them common issues, some not so common; some of them plain issues, some more esoteric; and a couple because, well, just because they're fun.

This book is about all aspects of C++. I don't mean to say that it touches on every detail of C++--that would require many more pages--but rather that it draws from the wide palette of the C++ language and library features to show how apparently unrelated items can be used together to synthesize novel solutions to common problems. It also shows how apparently unrelated parts of the palette interrelate on their own, even when you don't want them to, and what to do about it. You will find material here about templates and namespaces, exceptions and inheritance, solid class design and design patterns, generic programming and macro magic--and not just as randomized tidbits, but as cohesive Items showing the interrelationships among all of these parts of modern C++.

What's "More?"

More Exceptional C++ continues where Exceptional C++ left off. This book follows in the tradition of the first: It delivers new material, organized in bite-sized Items and grouped into themed sections. Readers of the first book will find some familiar section themes, now including new material, such as exception safety, generic programming, and memory management techniques. The two books overlap in structure and theme, not in content.

Where else does More Exceptional C++ differ? This book has a much stronger emphasis on generic programming and on using the C++ standard library effectively, including coverage of important techniques such as traits and predicates. Several Items provide in-depth looks at considerations to keep in mind when using the standard containers and algorithms; many of these considerations I've not seen covered elsewhere. There's a new section and two appendixes that focus on optimization in single- and multithreaded environments--issues that are now more than ever of practical consequence for development shops writing production code.

Versions of most Items originally appeared in Internet and magazine columns, particularly as Guru of the Week GotW issues #31 to 62, and as print columns and articles I've written for C/C++ Users Journal, Dr. Dobb's Journal, the former C++ Report, and other publications.If you don't, start with a good C++ introduction and overview. Good choices are a classic tome like Bjarne Stroustrup's The C++ Programming Language Stroustrup00, or Stan Lippman and Josee Lajoie's C++ Primer, Third Edition Lippman98. Next, be sure to pick up a style guide such as Scott Meyers' classic Effective C++ books Meyers96 Meyers97. I find the browser-based CD version Meyers99 convenient and useful.

How to Read This Book

Each Item in this book is presented as a puzzle or problem, with an introductory header that resembles the following:

Item #: The Topic of This Puzzle
Difficulty: X

The topic tag and difficulty rating gives you a hint of what you're in for. Note that the difficulty rating is my subjective guess at how difficult I expect most people will find each problem, so you may well find that a "7" problem is easier for you than some "5" problem. Since writing Exceptional C++, I've regularly received e-mail saying that "Item #N is easier (or harder) than that!" It's common for different people to vote "easier!" and "harder!" for the same Item. Ratings are personal; any Item's actual difficulty for you really depends on your knowledge and experience and could be easier or harder for someone else. In most cases, though, you should find the rating to be a good rule-of-thumb guide to what to expect.

You might choose to read the whole book front to back; that's great, but you don't have to. You might decide to read all the Items in a section together because you're particularly interested in that section's topic; that's cool, too. Except where there are what I call a "miniseries" of related problems which you'll see designated as "Part 1," "Part 2," and so on, the Items are pretty independent, and you should feel free to jump around, following the many cross-references among the Items in the book, as well as some references to Exceptional C++. The only guidance I'll offer is that the miniseries are designed to be read consecutively as a group; other than that, the choice is yours.

Namespaces, Typename, References, and Other Conventions

I make quite a few recommendations in this book, and I won't give you guidelines that tell you to do something I don't already do myself. That includes what I do in my own example code throughout this book. I'll also bow to existing practice and modern style, even when it really makes no material difference.

On that note, a word about namespaces: In the code examples, if you see a using-directive at file scope in one example and at function scope in another example a few pages or Items later, there's no deeper reason than that's what felt right and aesthetically pleasing to me for that particular case; for the rationale, turn to Item 40. In the narrative text itself, I've chosen to qualify standard library names with std:: when I want to emphasize that it's the standard facility I'm talking about. Once that's established, I'll generally switch back to using the unqualified name.

When it comes to declaring template parameters, I sometimes come across people who think that writing class instead of typename is old-fashioned, even though there's no functional difference between the two and the standard itself uses class most everywhere. Purely for style, and to emphasize that this book is about today's modern C++, I've switched to using typename instead of class to declare template parameters. The only exception is one place in Item 33, where I quote directly from the standard; the standard says class, so I left it in there.

Unless I call something a "complete program," it's probably not. Remember that the code examples are usually just snippets or partial programs and aren't expected to compile in isolation. You'll usually have to provide some obvious scaffolding to make a complete program out of the snippet shown.

Finally, a word about URLs: On the Web, stuff moves. In particular, stuff I have no control over moves. That makes it a real pain to publish random Web URLs in a print book lest they become out of date before the book makes it to the printer's, never mind after it's been sitting on your desk for five years.If you find that a link printed in this book no longer works, send me e-mail and tell me; I'll update that redirector to point to the new page's location (if I can find the page again) or to say that the page no longer exists (if I can't). Either way, this book's URLs will stay up-to-date despite the rigors of print media in an Internet world. Whew.

Herb Sutter
Toronto, June 2001

020170434XP11292001

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more


Customer Reviews

3 star
0
2 star
0
1 star
0
4.7 out of 5 stars
4.7 out of 5 stars
Most helpful customer reviews
4 of 4 people found the following review helpful
4.0 out of 5 stars 4.5 stars, good book May 20 2003
By A Customer
Format:Paperback
I read this book after reading Effective C++ by Scott Meyers. Being able to discuss specific topics rather than viewing a language as a whole was my preferred way of understanding C++, so the books by Sutter and Meyers fit me perfectly.
The main advantage the Exceptional C++ series has over the Meyers series is that you can tell Sutter is the better programmer. You can trust that everything Meyers says is correct but in the end all you really get is some extra pointers on how to do certain things. Sutter on the other hand gets a little deeper on the same topics and makes you feel like can write better C++ code, rather than just being able to format it better.
One complaint I had about Effective C++ by Meyers was that most of the book is text and contains very little code. My experience with reading programming books is that around 90% of plain text will not be retained. The only way verbal programming text will ever stick is if there is good code to accompany it. Since Sutter is a programmer first, author second, he provides more code examples and they seem to be more thought out.
If you have the time then you should probably read from both authors, however, if you don't want to read 4 books then you should probably read the Exceptional series over the Effective series.
Was this review helpful to you?
2 of 2 people found the following review helpful
5.0 out of 5 stars A reality check for those who know C++ June 22 2002
By Charles Ashbacher TOP 1000 REVIEWER
Format:Paperback
This book, like the earlier one by Sutter, was a reality check for me. Before I read it, I blissfully believed that I knew C++ really well. After all, I have taught it at the college and corporate level for ten years and programmed commercial code for three. I have also written and published material about the language in several journals. However, these forty exercises really opened my eyes and exercised my brain. They are excellent teaching material, showing you aspects of the language that are subtle, yet critical to know.
One topic that I experienced firsthand is when an exception is thrown out of a constructor. This happened to me many years ago, and I spent hours trying to correct the code so that it finally did something similar to what I wanted. Had I been able to read items 17 and 18 of this book, I could have cut that to about twenty minutes and kept more of my hair.
The problems are all typical of those encountered in the "unusual average" day in the life of a C++ programmer. By that I mean that they may not necessarily reflect the day to day work, but are general enough to most likely crop up on some day for everyone who writes code in C++. The general categories are:
1) Generic programming and the C++ standard library
2) Optimization and Performance
3) Exception safety issues and techniques
4) Inheritance and polymorphism
5) Memory and resource management
6) Free functions and macros
7) Miscellaneous topics
There are many things going on behind the scenes in your C++ programs that most of the time you can ignore. However, when it is a time that you can't, then Sutter is one of the people to consult. His material is always well written and useful in the real world and I recommend this book to all my corporate clients.
Was this review helpful to you?
1 of 1 people found the following review helpful
4.0 out of 5 stars Interesting C++ book May 29 2007
Format:Paperback
Mr. Sutter's books biggest strength to my opinion is that they bring together a bunch of original advanced C++ topics that you cannot find anywhere else. This book has its share of very original content but I feel like the ratio original content vs topics that you can find in other books is lower in this book than with the other books of the serie. The most interesting section in this book in my opinion is the one on exception safety and the less original section is the one on generic programming and STL as you can find much of the information contained in this section in other books such as Effective STL from Scott Meyer or C++ Template from David Vandervoorde and Nicolai M. Josuttis.
Was this review helpful to you?
5.0 out of 5 stars Challenging and entertaining Oct. 24 2002
By uniq
Format:Paperback
In this book Herb Sutter continues investigating of the problems that face C++ developers. Even discussions of the problems that one is unlikely to confront reveal important aspects of the proper C++ programming.
The author often beats on a problem until it "has ceased to be ... expired and gone ... bereft of life ... rests in peace" (p. 118). In this particular book, most of the time this is a good thing, because in software development almost everything is a tradeoff, and you don't want to open the gates of hell as a side effect of plugging up a little hole.
I have enjoyed reading this book at least as much as its predecessor, "Exceptional C++". Unfortunately on occasion the author spends too much time discussing trivial implications that appear not to be in line with the complexity of other topics. Also, constant restatement of the parts of every problem statement is quite wasteful and distracting, especially considering the amount of space they occupy (sometimes 25% of the solution space!)
Was this review helpful to you?
4.0 out of 5 stars Herb Sutter strikes again ! Feb. 23 2002
Format:Paperback
Herb sutter's first book worth it's name : it was exceptional. That's why it was a challenge to write an equally good one as a second book. Of course, Herb put a lot of it's main ideas into his first book (like the "swap guts idiom" for example), but it leaves a big room for side subjects.
Topics in this volume are well classified, maybe better than in the first volume. They adress important subjects for the C++ day to day programmer : standard library, performances, exception safety, resource management, etc... The "engineering puzzles" are in fact much less important than the "solution" described bellow. Because each of the solution is not mid game but a practicle piece of work that leads you to a better C++ quality code.
Honestly, this book is not for beginner. It's much more valuable to read a primer book (stroustrup's C++ programing language, or better the Lipman's C++ primer) and then Meyer's effective C++. At least. You also should have a couple of year of C++ practice behind your belt (also at least). It's a top level C++ book, with top level advices and a top level payback for you.
After reading this volume, I have a stong impression that next Sutter's book will stay with such level of quality. Great work, Herb, thank you !
A last word : Maybe you are surprised I've not given 5 stars to this book ? Well I reserve such notation for strongly exceptional book, like the "design patterns". 4 stars still be very good on my own scale.
Was this review helpful to you?
Want to see more reviews on this item?

Look for similar items by category


Feedback