|
T
his
book is in the tradition of Scott Meyers'
Effective C++
volumes.
Like Meyers' books,
Exceptional C++: 47 Engineering Puzzles, Programming
Problems, and Exception-Safety Solutions
is organized in smaller sections
(the 47 items) and presents common C++ errors and corresponding solutions
in digestible pieces. Unlike Meyers' books, it includes "new" language
features such as exception handling, namespaces, and the STL, but also
more classical problem domains such as class design and memory management.
In a way, you could see it as an extension to "Effective C++" covering
modern C++.
We particularly like that
Exceptional
C++
is very readable. Each of the items has a clear focus, covering
exactly one aspect and nothing more. Herb Sutter is amazingly consistent;
his writing style perfectly matches his programming style: a class should
be responsible for exactly one, clearly defined task and nothing more.
The items in this book strictly abide by this rule. They are clear and
pointed and condense every discussion to a bunch of concrete rules. For
this reason,
Exceptional C++
has the quality of a good programming
style guide.
In addition to its remarkable readability,
Exceptional
C++
excels at the good choice it makes regarding topics. The main sections
cover the STL, exception safety, class design, compilation firewalls, name
lookup, and memory management. Seen as a whole, it gives a representative
overview of contemporary C++ programming techniques. It is short on template
programming, however. Herb Sutter feels that the intense use of templates
will render your programs non-portable because the compilers do not support
templates well enough. This, unfortunately, is correct but it's a reservation
of decreasing relevance, because compilers will gradually catch up with
the standard.
Despite this minor blemish,
Exceptional
C++
presents gems from various sources, just to name a few:
-
The pimpl idiom draws from insulation
techniques published by Lakos and earlier by Coplien
-
Member function hiding is a long-known
effect; see Meyers, for instance
-
The section on class design and inheritance
draws on Barton & Nackman and Bob Martin
-
STL problems are part of every in-depth
seminar or book on the STL
-
Exception handling has been discussed
in magazine articles, most of which appeared in
C++ Report
If you don't have the time to read all
the excellent books and magazines listed in the bibliography, you might
find this relatively thin book (about 200 pages) very handy because it
distills the essence of modern C++ to a number of items and rules.
Last but not least,
Exceptional
C++
is fun to read. Each item is introduced as a puzzle to the reader,
and each puzzle is rated for its difficulty. (This playful style stems
from Sutter's "
Guru
of the Week
", a regular feature of the Usenet newsgroup comp.lang.c++.moderated.)
We predict that even experienced C++ programmers will find a challenge
here and there. If you read this book cover to cover and do not encounter
a single surprise, please let us know.
Exceptional C++
is a highly
recommendable book for the serious C++ programmer. Its main merit is that
it gathers bits and pieces of wisdom that emerged in the community during
the past couple of years and presents them as a fun-to-read book of digestible
size.
Angelika Langer
develops
and teaches classes on advanced C++, STL, multithreading, internationalization,
and Java. She served on the ANSI/ISO C++ Committee from 1993 to 1998.
Klaus
Kreft
is a software architect and consultant with 15+ years of experience
in industrial software development. He works for Siemens Business Services
in Germany. Langer and Kreft are authors of "Standard C++ IOStreams and
Locales: Advanced Programmer's Guide and Reference" (Addison-Wesley, 1999)
and are columnists for
C++
Report
magazine.
|