@karthikraman

Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)

. Addison-Wesley Professional, 3 edition, (May 22, 2005)

Abstract

This exceptionally useful text offers Scott Myers's expertise in C++ class design and programming tips. The second edition incorporates recent advances to C++ included in the ISO standard, including namespaces and built-in template classes, and is required reading for any working C++ developer.<p> The book opens with some hints for porting code from C to C++ and then moves on to the proper use of the <I>new</I> and <I>delete</I> operators in C++ for more robust memory management. The text then proceeds to class design, including the proper use of constructors, destructors, and overloaded operator functions for assignment within classes. (These guidelines ensure that you will create custom C++ classes that are fully functional data types, which can be copied and assigned just like built-in C++ classes.)<p> The author also provides a handful of suggestions for general class design, including strategies for using different types of inheritance and encapsulation. Never doctrinaire and always intelligent, these guidelines can make your C++ classes more robust and easier to maintain. <I>--Richard Dragan</I> I wrote the original edition of Effective C++ in 1991. When the time came for a second edition in 1997, I updated the material in important ways, but, because I didn't want to confuse readers familiar with the first edition, I did my best to retain the existing structure: 48 of the original 50 Item titles remained essentially unchanged. If the book were a house, the second edition was the equivalent of freshening things up by replacing carpets, paint, and light fixtures. For the third edition, I tore the place down to the studs. (There were times I wished I'd gone all the way to the foundation.) The world of C++ has undergone enormous change since 1991, and the goal of this book -; to identify the most important C++ programming guidelines in a small, readable package -; was no longer served by the Items I'd established nearly 15 years earlier. In 1991, it was reasonable to assume that C++ programmers came from a C background. Now, programmers moving to C++ are just as likely to come from Java or C\#. In 1991, inheritance and object-oriented programming were new to most programmers. Now they're well-established concepts, and exceptions, templates, and generic programming are the areas where people need more guidance. In 1991, nobody had heard of design patterns. Now it's hard to discuss software systems without referring to them. In 1991, work had just begun on a formal standard for C++. Now that standard is eight years old, and work has begun on the next version. To address these changes, I wiped the slate as clean as I could and asked myself, What are the most important pieces of advice for practicing C++ programmers in 2005? The result is the set of Items in this new edition. The book has new chapters on resource management and on programming with templates. In fact, template concerns are woven throughout the text, because they affect almost everything in C++. The book also includes new material on programming in the presence of exceptions, on applying design patterns, and on using the new TR1 library facilities. (TR1 is described in Item54.) It acknowledges that techniques and approaches that work well in single-threaded systems may not be appropriate in multithreaded systems. Well over half the material in the book is new. However, most of the fundamental information in the second edition continues to be important, so I found a way to retain it in one form or another. (You'll find a mapping between the second and third edition Items in Appendix B.) I've worked hard to make this book as good as I can, but I have no illusions that it's perfect. If you feel that some of the Items in this book are inappropriate as general advice; that there is a better way to accomplish a task examined in the book; or that one or more of the technical discussions is unclear, incomplete, or misleading, please tell me. If you find an error of any kind -; technical, grammatical, typographical, whatever -; please tell me that, too. I'll gladly add to the acknowledgments in later printings the name of the first person to bring each problem to my attention. Even with the number of Items expanded to 55, the set of guidelines in this book is far from exhaustive. But coming up with good rules -; ones that apply to almost all applications almost all the time -; is harder than it might seem. If you have suggestions for additional guidelines, I would be delighted to hear about them. I maintain a list of changes to this book since its first printing, including bug fixes, clarifications, and technical updates. The list is available at the Effective C++ Errata web page, a href="http://aristeia.com/BookErrata/ec++3e-errata.html"

Links and resources

Tags

community

  • @karthikraman
  • @gwpl
@karthikraman's tags highlighted