Introduction
Yes, it's the return of Herb Sutter, with "40 New Engineering Puzzles, Programming Problems, and Solutions." If you thought that you had your back covered after reading the excellent predecessor, Exceptional C++ [1], think again.One should expect quite a lot from a book like this; it's part of Bjarne Stroustrup's [2] In-Depth Series [3], which is a promise of quality in and of itself. Furthermore, if you know who Herb Sutter is, and maybe have read the previous book in the series, you demand cutting-edge material, generously sprinkled with insights extraordinaire. The question, then, is whether this book delivers according to your expectations. We shall see.
What's So Special about This Book?
You read CUJ because it offers something unique that is valuable to you, and the same applies to the books you buy -- if there's no unique value that applies to you, there's no reason to spend time and money. I'll cut right to the chase and list the major themes (and thus values) in this book:
- How to use the C++ Standard library effectively.
- Exception safety: what it is, what it isn't, and how to get there.
- Modern use of C++: generic programming, use of namespaces, etc.
Structure
The book is divided into items, where each item starts with a question, which is then answered in great detail. Each item is self-contained, although some are also part of miniseries. There's a difficulty rating attached to the items, to give a hint of how hard it is to solve the problems. Furthermore, the book is divided into seven different subsections:
- Generic Programming and the C++ Standard Library
- Optimization and Performance
- Exception Safety Issues and Techniques
- Inheritance and Polymorphism
- Memory and Resource Management
- Free Functions and Macros
- Miscellaneous Topics
Should You Read This Book?
Yes, you definitely should, because it will make you a better programmer, and it's an enlightening and amusing book. The real question is probably when. To get the most out of these 40 items, a deep understanding of C++ and the standard library is a must [4]. For a programmer new to C++, reading this book would be intimidating. I'd recommend that at least some, and preferably all, of [5,6,7,8] are read before taking on More Exceptional C++.Note that the value of the book goes beyond the items and the joy of being challenged, because these seemingly innocent questions bring forth an understanding of one's strengths and weaknesses in C++ (in general) and the standard library (in particular).
How Should You Read the Book?
Most importantly, do not read it in haste. Before you turn the page and start looking at the answer(s), try hard to solve the problem. It's fine to be wrong, to find a different solution, or to be caught in one of numerous traps; that's the path to real understanding. Personally, I find that it's much harder to pretend that I knew the right answer if I've given it my best shot, and failed.... The book doesn't impose a certain reading order, and my advice is to go wherever inspiration leads you -- the items are typically self-contained.
Summary
After a book such as Exceptional C++, which not only was true to its name, but also came across with inexorable C++ power and dazzling insights, it must be very, very hard to write the sequel. It's inevitable that comparisons are made between the two, so I'll tell it to you straight: More Exceptional C++ is at least as rewarding as its predecessor, and in particular, it seems more focused and better categorized. It's one of the best books on advanced C++ out there, and I would not leave home without it. Neither should you.
References
[1] Herb Sutter. Exceptional C++ (Addison-Wesley, 2000.)[2] The Creator (of C++).
[3] The C++ In-Depth Series is published by Addison-Wesley, with books that are endorsed by Bjarne Stroustrup.
[4] To get a feel for your current level, as well as an idea of where these Items came from, visit <www.gotw.ca/gotw>.
[5] Stanley B. Lippman. Essential C++ (Addison-Wesley, 1999).
[6] Scott Meyers. Effective C++: 50 Specific Ways to Improve Your Programs and Design, 2nd Edition (Addison-Wesley, 1997).
[7] Nicolai M. Josuttis. The C++ Standard Library: A Tutorial and Reference (Addison-Wesley, 1999.)
[8] Bjarne Stroustrup. The C++ Programming Language, 3rd Edition (Addison-Wesley, 1997).
About the Author
Bjorn Karlsson works as a project manager at ReadSoft. He is the kind of out-going guy who likes to read ISO/IEC 14882:98. Bjorn can be reached at [email protected].