Aimed at the experienced C++ programmer, Herb Sutter's
Exceptional C++ tests the reader's knowledge of advanced C++ language features and idioms with several dozen programming puzzles and explanations. This book can definitely help raise your C++ class design skills to the next level.
Based on the author's Guru of the Week Web column, this book poses a series of challenging questions on the inner workings of C++, centering around generic programming with the Standard Template Library (STL), exception handling, memory management, and class design. Even if you think you know C++ well, most of these problems will teach you something more about the language and how to write more robust classes that are "exception safe" (meaning they don't throw any handled exceptions or leak resources). Don't think this is just "language lawyering," though. The author's explanations stress sound programming principles (favoring simplicity) and idioms (such as the
Pimpl idiom for class design that promotes faster compile times and better maintainability, or using "smart"
auto_ptrs with STL.) Judging from the range and depth of these examples, Sutter's command of the inner workings of C++ is impressive, and he does an excellent job of conveying this expertise without jargon or a lot of theory.
After reading this book, C++ designers will learn several "best practices" of how to write robust, efficient classes that are "exception safe." Chances are you'll gain a better understanding of memory management techniques and working with STL too. For the experienced developer seeking leading-edge knowledge of some of the best ways to use C++,
Exceptional C++ is both a challenging and truly worthwhile source of information.
--Richard Dragan Topics covered: Advanced C++ programming tutorial, generic programming, tips for string classes, containers and STL, temporary objects, exception-safe code tutorial, virtual functions, class inheritance, the
Pimpl idiom, namespaces, memory management, C++ memory areas, overloading
new and
delete, using smart pointer with
auto_ptr, using
const, casts, and hints for better performance and code maintainability.
Customer Reviews & Comments
As a professional programmer I find the Guru of the Week questions annoying, because they usually point out that I don't know some dang thing about C++. (I don't know too many people who appreciate being pointed out how dumb they are weekly.) Then someone who appears to have nothing better to do than solve C++ puzzles jumps in with a 6 page submission on how to solve the problem, which is usually wrong. Then six more self appointed guru's jump in and fill pages of discussion, Then after filling my head with all the wrong answers to a particular problem, Herb smuggly answers the question with the real answer. Anoints another guru and the process repeats. In the meantime I've lost total interest in the discussion. Thank you for Deja news where I can read the first and last postings(The puzzle and the solution). That said, this book is full of those got ya! puzzles. Fortunately Herb is a kind writer and you don't feel too dumb when he points out why a particular puzzle has a problem and what it is. And like Deja news you can skip all the wrong answers, arguments about the arcane and get right to the meat of the problem. Herb also got a chance to make the puzzles more clear, where the language of the original puzzle confused the issue unnecessarily. The best reason to buy this book is that its the only published text so far on how to use C++ Exceptions. There are some articles in C++ Report but not many on the traps and pitfalls of their usage. Stroustrup's book "C++ Programming Language" tells you how the mechanism works, and makes some suggestions. Herb tells you what it will cost you if you don't use them, only partially use them, or totally abuse them. And he shows you how a minor misuse can make you have major problems. I can see why Scott Meyers likes this book. Its just like his books, "Effective C++" series only the format is not in a lecture topic but in a question/puzzle answer format. I prefer the Meyer's approach but you can still glean the necessary information, and while you are reading the answers to the puzzles, say to yourself "Yeah I knew that!" One other reason to buy this book, you can use these puzzles as tests for interviews. First, it will help you know the skill level of the applicant, Second it will teach you something you probably should have known anyway, Thirdly if they get the answers right off it will tell you that the applicants at least read the texts and are trying to stay on top of things. This is not to say you should make applicants take an all day C++ grammer test but by asking a few puzzle questions you can see how they react under a bit of pressure. After all at some point everyone comes up against a problem they haven't seen.