Effective C++: 50 Specific Ways to Improve Your Programs and Designs (Addison-Wesley Professional Computing Series) Subsequent Edition
|
Scott Meyers
(Author)
Find all the books, read about the author, and more.
See search results for this author
|
Use the Amazon App to scan ISBNs and compare prices.
There is a newer edition of this item:
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
-
Apple
-
Android
-
Windows Phone
-
Android
|
Download to your computer
|
Kindle Cloud Reader
|
Customers who viewed this item also viewed
What other items do customers buy after viewing this item?
Editorial Reviews
Amazon.com Review
The book opens with some hints for porting code from C to C++ and then moves on to the proper use of the new and delete 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.)
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. --Richard Dragan
Review
Effective C++ CD is the HTML (Netscape-oriented) version of Scott Meyers' previous two works, Effective C++, Second Edition and More Effective C++. Additionally, five supplementary magazine articles appear in the collection. There are also links to relevant material on the Web which that been added to the current edition and which did not appear in the print edition.
Scott Meyers' work is so well known as scarcely to need introduction. Respect for his C++ acumen and pedagogic skills is so widespread that I was prepared to thoroughly detest his work, which I have encountered often but barely deigned to read to date.
On close examination, I find Meyers' books to be superb.
Of the 50 catechismic "Items" in the body of Effective C++, the vast majority are of critical importance to solid C++ programming. Virtually everything Scott Meyers suggests on these subjects is germane and practical. Where one could conceivably differ with Meyers' approach, his is nevertheless an entirely sound approach.
The second volume, More Effective C++, is cast in the same mold as the first volume. Here the discussion of 35 further "Items" tends to devolve somewhat towards matters of style. However, these are still critical issues being raised that the intermediate C++ programmer must confront sooner or later, athey are shipped too early. They fail because they arenthey are shipped too early. They fail because they arens presented in Meyers' rich and sympathetic tutorial prose. --Jack Woehr, Dr. Dobb's Journal -- Dr. Dobb's Journal
From the Back Cover
Each of this book's 50 guidelines summarizes a way to write better C++, and the accompanying discussions are backed by specific examples. For this new edition, Meyers reworked every guideline in the book. The result is exceptional adherence to C++'s Draft International Standard, current compiler technology, and the latest insights into the use of C++ for real-world applications.
Highlights of Effective C++, Second Edition include:
- Expert guidance on object-oriented design, class design, and the proper use of inheritance
- An examination of the standard C++ library, including how the Standard Template Library and classes like string and vector affect the structure of well-written programs
- Discussions of late-breaking language features like in-class constant initializations, namespaces, and member templates
- Wisdom usually possessed by only the most experienced developers
0201924889B04062001
About the Author
Scott Meyers is one of the world's foremost authorities on C++ software development. He is a former columnist for C++ Report, a frequent contributor to C/C++ Users Journal and Dr. Dobb's Journal, and a consultant to clients worldwide. A member of the Advisory Boards for NumeriX LLC and InfoCruiser Inc., he has a Ph.D. in Computer Science from Brown University.
0201924889AB05032001
Excerpt. © Reprinted by permission. All rights reserved.
This book is a direct outgrowth of my experiences teaching C++ to professional programmers. I've found that most students, after a week of intensive instruction, feel comfortable with the basic constructs of the language, but they tend to be less sanguine about their ability to put the constructs together in an effective manner. Thus began my attempt to formulate short, specific, easy-to-remember guidelines for effective software development in C++: a summary of the things experienced C++ programmers almost always do or almost always avoid doing. I was originally interested in rules that could be enforced by some kind of lint-like program. To that end, I led research into the development of tools to examine C++ source code for violations of user-specified conditions. Unfortunately, the research ended before a complete prototype could be developed. Fortunately, several commercial C++-checking products are now available.
Though my initial interest was in programming rules that could be automatically enforced, I soon realized the limitations of that approach. The majority of guidelines used by good C++ programmers are too difficult to formalize or have too many important exceptions to be blindly enforced by a program. I was thus led to the notion of something less precise than a computer program, but still more focused and to-the-point than a general C++ textbook. The result you now hold in your hands: a book containing 50 specific suggestions on how to improve your C++ programs and designs. In this book, you'll find advice on what you should do, and why, and what you should not do, and why not. Fundamentally, of course, the whys are more important than the whats, but it's a lot more convenient to refer to a list of guidelines than to memorize a textbook or two.
Unlike most books on C++, my presentation here is not organized around particular language features. That is, I don't talk about constructors in one place, about virtual functions in another, about inheritance in a third, etc. Instead, each discussion in the book is tailored to the guideline it accompanies, and my coverage of the various aspects of a particular language feature may be dispersed throughout the book. The advantage of this approach is that it better reflects the complexity of the software systems for which C++ is often chosen, systems in which understanding individual language features is not enough. For example, experienced C++ developers know that understanding inline functions and understanding virtual destructors does not necessarily mean you understand inline virtual destructors. Such battle-scarred developers recognize that comprehending the interactions between the features in C++ is of the greatest possible importance in using the language effectively. The organization of this book reflects that fundamental truth.
The disadvantage of this design is that you may have to look in more than one place to find everything I have to say about a particular C++ construct. To minimize the inconvenience of this approach, I have sprinkled cross-references liberally throughout the text, and a comprehensive index is provided at the end of the book. In preparing this second edition, my ambition to improve the book has been tempered by fear. Tens of thousands of programmers embraced the first edition of Effective C++, and I didn't want to destroy whatever characteristics attracted them to it. However, in the six years since I wrote the book, C++ has changed, the C++ library has changed (see Item 49), my understanding of C++ has changed, and accepted usage of C++ has changed. That's a lot of change, and it was important to me that the technical material in Effective C++ be revised to reflect those changes. I'd done what I could by updating individual pages between printings, but books and software are frighteningly similar--there comes a time when localized enhancements fail to suffice, and the only recourse is a system-wide rewrite. This book is the result of that rewrite: Effective C++, Version 2.0.
Those familiar with the first edition may be interested to know that every Item in the book has been reworked. I believe the overall structure of the book remains sound, however, so little there has changed. Of the 50 original Items, I retained 48, though I tinkered with the wording of a few Item titles (in addition to revising the accompanying discussions). The retired Items (i.e., those replaced with completely new material) are numbers 32 and 49, though much of the information that used to be in Item 32 somehow found its way into the revamped Item 1. I swapped the order of Items 41 and 42, because that made it easier to present the revised material they contain. Finally, I reversed the direction of my inheritance arrows. They now follow the almost-universal convention of pointing from derived classes to base classes. This is the same convention I followed in my 1996 book, More Effective C++, an overview of which you can find on pages 237-238 of this volume. The set of guidelines in this book is far from exhaustive, but coming up with good rules--ones that are applicable to almost all applications almost all the time--is harder than it looks. Perhaps you know of additional guidelines, of more ways in which to program effectively in C++. If so, I would be delighted to hear about them.
On the other hand, you may 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. I encourage you to let me know about these things, too.
Donald Knuth has a long history of offering a small reward for people who notify him of errors in his books. The quest for a perfect book is laudable in any case, but in view of the number of bug-ridden C++ books that have been rushed to market, I feel especially strongly compelled to follow Knuth's example. Therefore, for each error in this book that is reported to me--be it technical, grammatical, typographical, or otherwise--I will, in future printings, gladly add to the acknowledgments the name of the first person to bring that error to my attention.
Send your suggested guidelines, your comments, your criticisms, and--sigh--your bug reports to:
Scott Meyers
c/o Publisher, Corporate and Professional Publishing to ec++@awl.com.
Excerpt. © Reprinted by permission. All rights reserved.
This book is a direct outgrowth of my experiences teaching C++ to professional programmers. I've found that most students, after a week of intensive instruction, feel comfortable with the basic constructs of the language, but they tend to be less sanguine about their ability to put the constructs together in an effective manner. Thus began my attempt to formulate short, specific, easy-to-remember guidelines for effective software development in C++: a summary of the things experienced C++ programmers almost always do or almost always avoid doing.
I was originally interested in rules that could be enforced by some kind of lint-like program. To that end, I led research into the development of tools to examine C++ source code for violations of user-specified conditions. Unfortunately, the research ended before a complete prototype could be developed. Fortunately, several commercial C++-checking products are now available.
Though my initial interest was in programming rules that could be automatically enforced, I soon realized the limitations of that approach. The majority of guidelines used by good C++ programmers are too difficult to formalize or have too many important exceptions to be blindly enforced by a program. I was thus led to the notion of something less precise than a computer program, but still more focused and to-the-point than a general C++ textbook. The result you now hold in your hands: a book containing 50 specific suggestions on how to improve your C++ programs and designs.
In this book, you'll find advice on what you should do, and why, and what you should not do, and why not. Fundamentally, of course, the whys are more important than the whats, but it's a lot more convenient to refer to a list of guidelines than to memorize a textbook or two.
Unlike most books on C++, my presentation here is not organized around particular language features. That is, I don't talk about constructors in one place, about virtual functions in another, about inheritance in a third, etc. Instead, each discussion in the book is tailored to the guideline it accompanies, and my coverage of the various aspects of a particular language feature may be dispersed throughout the book.
The advantage of this approach is that it better reflects the complexity of the software systems for which C++ is often chosen, systems in which understanding individual language features is not enough. For example, experienced C++ developers know that understanding inline functions and understanding virtual destructors does not necessarily mean you understand inline virtual destructors. Such battle-scarred developers recognize that comprehending the interactions between the features in C++ is of the greatest possible importance in using the language effectively. The organization of this book reflects that fundamental truth.
The disadvantage of this design is that you may have to look in more than one place to find everything I have to say about a particular C++ construct. To minimize the inconvenience of this approach, I have sprinkled cross-references liberally throughout the text, and a comprehensive index is provided at the end of the book.
In preparing this second edition, my ambition to improve the book has been tempered by fear. Tens of thousands of programmers embraced the first edition of Effective C++ , and I didn't want to destroy whatever characteristics attracted them to it. However, in the six years since I wrote the book, C++ has changed, the C++ library has changed (see Item 49), my understanding of C++ has changed, and accepted usage of C++ has changed. That's a lot of change, and it was important to me that the technical material in Effective C++ be revised to reflect those changes. I'd done what I could by updating individual pages between printings, but books and software are frighteningly similar--there comes a time when localized enhancements fail to suffice, and the only recourse is a system-wide rewrite. This book is the result of that rewrite: Effective C++, Version 2.0.
Those familiar with the first edition may be interested to know that every Item in the book has been reworked. I believe the overall structure of the book remains sound, however, so little there has changed. Of the 50 original Items, I retained 48, though I tinkered with the wording of a few Item titles (in addition to revising the accompanying discussions). The retired Items (i.e., those replaced with completely new material) are numbers 32 and 49, though much of the information that used to be in Item 32 somehow found its way into the revamped Item 1. I swapped the order of Items 41 and 42, because that made it easier to present the revised material they contain. Finally, I reversed the direction of my inheritance arrows. They now follow the almost-universal convention of pointing from derived classes to base classes. This is the same convention I followed in my 1996 book, More Effective C++, an overview of which you can find on pages 237-238 of this volume.
The set of guidelines in this book is far from exhaustive, but coming up with good rules--ones that are applicable to almost all applications almost all the time--is harder than it looks. Perhaps you know of additional guidelines, of more ways in which to program effectively in C++. If so, I would be delighted to hear about them.
On the other hand, you may 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. I encourage you to let me know about these things, too.
Donald Knuth has a long history of offering a small reward for people who notify him of errors in his books. The quest for a perfect book is laudable in any case, but in view of the number of bug-ridden C++ books that have been rushed to market, I feel especially strongly compelled to follow Knuth's example. Therefore, for each error in this book that is reported to me--be it technical, grammatical, typographical, or otherwise--I will, in future printings, gladly add to the acknowledgments the name of the first person to bring that error to my attention.
Send your suggested guidelines, your comments, your criticisms, and--sigh--your bug reports to:
Scott Meyers
c/o Publisher, Corporate and Professional Publishing
Addison Wesley Longman, Inc.
1 Jacob Way
Reading, MA 01867
U. S. A.
Alternatively, you may send electronic mail to ec++@awl.com.
I maintain a list of changes to this book since its first printing, including bug-fixes, clarifications, and technical updates. This list is available at the Effective C++ World Wide Web site, http://www.aw.com/cseng/titles/0-201-92488-9/. If you would like a copy of this list, but you lack access to the World Wide Web, please send a request to one of the addresses above, and I will see that the list is sent to you.
SCOTT DOUGLAS MEYERSSTAFFORD, OREGON
JULY 1997
0201924889P04062001
I'd like to read this book on Kindle
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- Publisher : Addison-Wesley; Subsequent edition (September 1, 1997)
- Language : English
- Paperback : 256 pages
- ISBN-10 : 0201924889
- ISBN-13 : 978-0201924886
- Item Weight : 15.7 ounces
- Dimensions : 7.75 x 0.5 x 9.5 inches
-
Best Sellers Rank:
#1,887,768 in Books (See Top 100 in Books)
- #482 in C Programming Language
- #746 in C++ Programming Language
- #5,149 in Computer Programming Languages
- Customer Reviews:
Customer reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Scott's easy-going writing style makes the explanations easy to read and digest. Unlike other books I've read, Scott provides detailed explanations allowing you to really understand the topic at hand. The 50 items are self-contained chunks of information, each thoroughly covering a specific topic.
C++ developers working for me are required to read this book (and Scott's companion, "More Effective C++") before I let them write a line of production code.
Many C++ books span 500 pages or more. Granted, there are many tutorial books that need to cover the basics, and then (hundreds of pages later) cover subjects for a non-neophyte. This book is reasonably short (about 225 pages), but full of ideas for the intermediate programmer.
This is one of the few technical books you can read from cover to cover. Many are good for references, but aren't accessible. This is both.
Some items need to be updated, however. For example, Item 28, "Use structs to partition the global namespace", you can use namespace now (it is also mentioned at the bottom of the page).
I think the items can be better organized, for example Item 23 "Don't try to return a reference when you must return an object" and item 31 "Never return a reference to a local object or a dereferenced pointer initialized by new within the function" can be combined to one, in item 23, "object" means a local object, it is better to say it explicitely. Also similar items are better to put closer, maybe it is difficult, since many items relate to each other.
This is a book for intermediary level, it lacks some more advanced issues as exception, namespace, etc. Exceptions are discussed in its following book <<More effective C++>>, however, I would like to mention the discussion in <<more effective C++>> is not complete neither, up to now, I can find the most advanced discussions about exception in <<Exceptional C++>> by Herb Sutter, which is the book a advanced programmer should read. Discussion about namespace can also be found in this book.
Overall, I think <<Effective C++>> is a good book for a serious programmer to start his/her c++ career, he/she can read <<More effective C++>> and <<Exceptional C++>> (maybe also <<Advanced C++ styles and idioms>> and <<C++ for real programmers>>) for more advanced topics/discussions, and <<C++ faq>> for a complete review of C++.
I regret not being able to find a book for comparison of C++ and java, two most used programming languages. These two languages are similar in syntax, but have different features. For example, auto_ptr exists only for C++ and delegation exists only for java, The differences of languages affect the design and implementation, <<Design patterns>> discussed the design patterns with C++ and Smalltalk, however, Java is more popular than Smalltalk now and I hope to find a book which discusses the C++ and Java together. A more complete discussion of C++ advanced features is also needed, Herb Sutter is working on this.
Top reviews from other countries
The book is structured in such a way that you don't have to read it heads to tail, you can simply start with a topic that you are interested in.
Weather you have a lot of experience in c++ or you are just picking it up, you will find this book enlightening.
I would definitely recommend it.





