Effective C++ Third Edition
Scott Meyers (2005)

Book review by Ted Felix

   

C++ is a huge and complex language. Becoming an expert at it requires a lot of study and experience. This book captures a good portion of the wisdom needed to get you started. This is not a beginner's book. It is intended to be read after reading an introductory C++ book and spending some time with the language.

The book is broken down into 55 specific pieces of C++ programming advice. The advice ranges from the obvious, "Pay attention to compiler warnings" (item 53), to the not so obvious, "Avoid hiding inherited names" (item 33), to the blasphemous, "Prefer non-member non-friend functions to member functions" (item 23). There's something for everyone here. Even if you are an expert, reading this book will exercise your brain and keep your expertise fresh.

This book is a really great way to discover the enormous complexity that is C++. Many of the items reinforced my belief that some of the features of the language should be avoided in order to maintain sanity. There are so many things one must keep in mind when using templates, exceptions, and overloading that the benefits rarely outweigh the disadvantages. This book helps you to think more critically and weigh the advantages and disadvantages of language features before using them.

I found the discussion of tr1 and Boost to be most interesting. I currently use Rich Hickey's callback mechanism extensively to decouple classes. Item 35: "Consider alternatives to virtual functions" presents std::tr1::bind() as a potential standard replacement for Rich Hickey's mechanism. I'm looking forward to having a compiler that supports this new callback approach.

Meyers's coverage of template metaprogramming in item 48 almost makes you want to spend some time learning it.

Complaints

The 55 items are not organized progressively from easy to hard. Instead, they are organized into coherent categories. This can be frustrating if an item is rather difficult to understand. Reading through the difficult parts is a good idea as the next item might be easier to grasp. Plan on reading the book two or three times, and it will all make sense.

Being intended for advanced users of the language, much of the book focuses on features like exceptions and templates. A good portion of the book is useless unless you are a serious library developer. Still, it is interesting to see how the other half lives, even if you'll never code a template in your entire career.

The second edition's coverage of resource management was more concrete. Item 14 in this edition is a bit abstract and might be misunderstood. I'm assuming that maybe introductory C++ texts are better at explaining that when you have a non-trivial destructor, you must have a copy constructor and operator= even if they are simply private. This was something that really tripped me up with C++ in the early years. It might be a good idea to read the second edition along with this edition as it does have a different perspective on C++.

Recommendations

This book belongs on every intermediate and advanced C++ developer's bookshelf. It should be re-read yearly to keep your understanding of the dark parts of the language fresh. Very highly recommended.

Other books by Meyers.    "More Effective C++" is the sequel to this book's second edition. It digs even deeper into the language. The "Effective C++ CD" contains searchable html versions of Effective C++ Second Edition (the older version) and More Effective C++ at a substantial savings. Meyers's "Effective STL" covers the C++ Standard Template Library.

Buy the Book

If you found this review helpful and you plan to buy the book, click on this link to buy the book from Amazon:

Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition) (Addison-Wesley Professional Computing Series)

A portion of the sale will go to help support this website. Thanks.

Read from 1/29/2007 to 2/14/2007.

<- Back to my software books page.

Copyright ©2007, Ted Felix. Disclaimer