"Exceptional C++," incorporated with the latest standard in C++ programming, shows by example how to go about sound software engineering in standard C++. Do you enjoy solving thorny C++ problems and puzzles? Do you relish writing robust and extensible code? Then take a few minutes and challenge yourself with some tough C++ design and programming problems. The puzzles and problems in "Exceptional C++ "not only entertain, they will help you hone your skills to become the sharpest C++ programmer you can be. Many of these problems are culled from the famous Guru of the Week feature of the Internet newsgroup comp.lang.c++.moderated, expanded and updated to conform to the official ISO/ANSI C++ Standard. Each problem is rated according to difficulty and is designed to illustrate subtle programming mistakes or design considerations. After you've had a chance to attempt a solution yourself, the book then dissects the code, illustrates what went wrong, and shows how the problem can be fixed. Covering a broad range of C++ topics, the problems and solutions address critical issues such as: Generic programming and how to write reusable templates Exception safety issues and techniques Robust class design and inheritance Compiler firewalls and the Pimpl Idiom Name lookup, namespaces, and the Interface Principle Memory management issues and techniques Traps, pitfalls, and anti-idioms Optimization Try your skills against the C++ masters and come away with the insight and experience to create more efficient, effective, robust, and portable C++ code.
It should be 5 stars because of the quality of the content, but unfortunately this book hasn't been updated for modern C++.
Exceptional C++ honours its name and has great pieces of advice. Some parts, like advanced memory management, are quite tricky, and will require me a second read. Others, like the use of the Pimpl idiom, what to add into an interface, name resolution, and how to write exception-safe code are useful from the first time.
This series is really good and brings to light a lot of C++ related issues people need to be aware of.
It also makes you realize, though, how much C++ is your enemy. How you have to fight the language to get stuff done. You may be at a point in your journey where you have become numb to this fact. But then reading this series you think about:
1. The Pimpl idiom, a huge mess of a method to get boxed objects (invisible and automatic in every language of the last 20 years)
2. Slicing, something you have to constantly watch out for in C++ (a complete nonissue in other languages)
3. how basically every component of the C++ standard library except the STL is poorly designed
4. Ridiculous template error messages
5. components of the C++ standard that are almost universally unimplemented and considered stupid (export...)
6. how incredibly primitive is textual inclusion of header files? It's like this is 1965 or something.
7. And C-style macros! Wow.
8. Manual memory management. Oh, wait, now there's shared_ptr! The C++ community has reinvented reference counting garbage collection, only 50 years behind schedule. Oh, and you have to manually write crap for the things you want collected and deal with their interaction with manually collected stuff.
9. The absurd hoops you have to jump through to simulate things like nested functions.
10. Incompatible compilers and library implementations.
And on and on.
Now like I said if you write C++ you are dealing with at least some of these issues all the time, but maybe you have become numb. These books will remind you.
The first third-to-half is 5-star material, then it starts to fade. The chapter on exceptions highlights the biggest challenges with exceptions (really any form of transaction logic in procedural programming) in a way I haven't seen comprehensively covered before, well worth reading.
Except for the item covering auto_ptr, this book is still relevant today, 18 years after being published. Not only the content is valuable, but it's also well written and even funny sometimes.
Not bad, has some good nuggets here and there... However, I felt the Q&A format of the book added absolutely nothing. It's likely just a relic of him copy/pasting the content from his online column.