Meyers provides 50 short, specific, easy-to-remember guidelines that experienced C++ programmers either almost always do or almost always avoid. These rules are each followed by an explanation of the rule's important advice on how to implement it, and are supported by actual programming examples.
Scott Douglas Meyers is an American author and software consultant, specializing in the C++ computer programming language. He is known for his Effective C++ book series. During his career, he was a frequent speaker at conferences and trade shows.
I have owned this book for several years and typically re-read it about every year or so. To say that a book is necessary reading is sometimes hyperbolic, but if you want to understand C++ then it is the simple truth in this case. Meyers has written three books on C++ - this volume, "More Effective C++" and "Effective STL". You, fellow programmer, need them all. Plus "Design Patterns", of course. Stroustrup and the ACR probably belong beside them, but Meyers is uniquely readable - easily the best author in the ill-specified and degenerate language we refer to as "English" among all those writing about real languages spoken by real hardware. He's even funny, despite writing in a genre whose adherents usually require humour explained with diagrams. As the other books are more advanced and/or more impenetrable, this book should be the first one you read. Some C++ experts will disagree with me here, as you do need to know the basics to get the best out of this book, and they will point to Stroustrup. I have a copy of that, but I would not describe it as learning material; it is reference material. You can actually read Meyers for pleasure and for learning, and that's an unusual combination in our cloistered and obsessive developers' world.
Meyers will help you get the best out of C++. If you can write classes in Java or, God forbid, Visual Basic, then you can certainly write them in C++ and come up with a working piece of software. That is not the same as using the language effectively. C++ is a work of beauty, but it has many pitfalls and it requires some depth of knowledge to get the best out of it. It's also portable, and Meyers knows how to write portable code, which must surely be a consideration with Linux and Apple advancing into the market. All genuine C++ compilers comply with an ISO/ANSI standard, which in theory means that properly-designed C++ code will compile on any conformant compiler and can be ported to any chipset for which a compiler exists. In practice, of course, this is not quite so easy. Meyers is very familiar with the standard and has been involved in its evolution, which along with his experience of developing in C++ positions him perfectly to point out where portability can and cannot be taken for granted.
The book is divided into 55 items, any of which will do you nicely for the train-journey to work. It is divided into "Shifting from C to C++", "Memory Management","Constructors, Destructors and Assignment Operators" , "Classes and Functions: Design and Declaration", "Classes and Functions: Implementation", "Inheritance and Object-Oriented Design" and "Miscellany". This covers a lot of ground, but for my money the material on operators and that on object-oriented design are the best value. User-defined operators are the kind of thing that has C++ developers hugging themselves for joy at the sheer coolness of the language, while object-oriented design is a set of concepts that are to some extent framed by the language - you need to know what they "mean" in C++ in order to see what you can do with the language. In general, Meyers will have you writing classes that are smaller, express their purpose more clearly and are less prone to generate impenetrable bugs at run-time, all of which are worthy design goals. Do it right and your errors will come up at compile or at link time (Item 46), and this is a good thing; let the compiler and the strong typing do your debugging before the bugs ever run.
Required reading. I mean it!
See also list: More Effective C++: 35 New Ways to Improve Your Programs and Designs Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library Design Patterns: Elements of Reusable Object-Oriented Software Comment
Only read If you are going to work professionally in C++ for the next couple of years. C++ gives you freedom to do lots of things the way you like and this is how things can go wrong in so many ways. This book is focused on teaching how to write bug free C++ code rather than creating maintainable object oriented solution. Again this book is very much C++ specific so read it to learn about C++ pitfalls and advice to avoid them.
My second reading to Scott Meyers, and this one was a confirmation to the elegant style of this great writer.
I'm not full aware of all what exists as books for C++ programming, though, I'm pretty sure that Scott's books are from the best out there, simply because it's not easy at all to have such a clear, simple and coherent understanding of the basic philosophy on which this complex language is built, prior to be able to write such a wonderful text.
Can't wait to read his other two books (More effective and Effective STL), thank you Scott for all of these marvels.
5 stars without even thinking, absolutely recommended.
C++ is a language that is impossible to learn "by doing", many things just need to be explained. That is why it is essential to have books like this one.
Some items are a little bit dated and I preferred Effective Modern C++. But a great read nevertheless. A must for people interested in C++.
This book is one of the rare software development books I have read by highlighting at least a sentence on every page. It was hard to grasp more than 20/30 pages at once for me. I highly recommend this book to who wants excel at being a better class designer. The sections related to smart pointers, templates, and template metaprogramming are superb. I don't recommend this book if you do not have at least some experience on STL and some basic knowledge of C++ programming. The level of customization and optimization power on your hands with C++ on objects and their lifecycle is non-comparable with any other major programming language. This book helps you to avoid hurting yourself with that power on some concepts and how to utilize that power at a maximum when needed. Highly recommend.
C++ is amazing .... ly complex, but that is its beauty. If you want to learn a language in what you can get results quickly and it is easy to program with, you should look for another one. The book is a good start to study the language in-depth. I really liked that wasn't just pure theory, there were several examples that showed how a specific suggestion, called Item in the book, improves the quality of the code. After finishing the book, I can read and understand C++ code easier, and understand the why-s of the language.
Surprisingly easy and fun to read, (it's not a reference book, you can read chapters in any order (mostly), can be read cover-to-cover, concise chapter end summaries, transmits a lot of tribal knowledge and here-be-dragons). A bit outdated though (a good exercise for the reader might be to make notes on which of the old stuff could be replaced with new language features).
Отличная книга, содержащая много интересных аспектов С++. Книга довольно-таки старая, но меж тем, все равно довольно-таки актуальная, так как затрагиваются важные всегда темы: конструкторы и деструкторы, операторы присваивания, управление ресурсами, некоторые нюансы проектирования программ и объявления, наследование и объектно-ориентированное проектирование, шаблоны и обобщенное программирование, настройка new и delete. Радует, что автор не просто перечисляет возможности языка, но и дает рекомендации о том, когда что использовать нужно и когда, наоборот, не стоит. Книга не самая объемная по тексту, но знаний, советов и рекомендаций тут вагон.
On the one hand, it is wonderful to have all of the details of C++ revealed and the many many many pitfalls identified. This is great.
On the other hand, I hate that C++ is such an awful language that a book like this is required!
As this book highlights, there are so many places in C++ where doing what looks like the right thing turns out to be the wrong thing. One simple example is that items in the constructor initialization list are not executed in order, instead, they are executed in the order that the items are declared in the class. Once you know that, it makes sense and is reasonable. But, unless someone tells you about this behavior, the natural assumption is that the initialization statements in the list would execute in order, just like everything else. Of course, for sane programs, the order of initialization in the list shouldn't matter but that's not the point. The point is that the behavior is non-obvious.
That being said, I do believe it is essential that anyone who is going to write C++ professionally should read and understand this book.
Most books on c++ just list features of the language, without really explaining when should you use them and how to combine them. This books does so. It will help you design cleaner, more stable, well formed, and efficient programs in C++.
Here are some of the most valueable (for me) subjects found in this book:
- Efficient memory management when you need it - Proper mechanisms to use to express yourself when writing classes - when to use templates, single inheritance, private inheritance; multiple inheritance and member inclusion - that is, expressing relations like "implemented using", "has" and "is a". - Division of interface and implementation - Sharing code between classes - Reducing the compile dependencies between files - Some coding errors to watch out for which the compiler cannot catch - Reducing runtime errors
And many more. The author of the book writes really clean and the book is easy to read. The examples are clean and to the point.
I have a doctorate degree in an area related to Computer Science. When I was applying for jobs a few years after graduate school (mid 2000s), someone told me that I should learn C++ or Java. (I had C and Pascal listed as the two most "modern" language that I had familiarity with.) I went to C++ first and absolutely hated it. Then I went to Java, which was better.
What I didn't like about C++ is that C++ is built on top of C, not approached as an entirely new language. As such, it has the worst of both worlds (in addition to the best of both worlds). The whole language seems like a bunch of kludges.
And now, this book comes into the discussion. This is the sort of book you need(ed) in order to write ... well, effective ... programs in the language, as opposed to (say) only using C's constructs. This book is a bit on the old side (1992) but does what it sets out to do, with an occasional bit of humor.
This book definitely has not aged well. While a lot of books from the same time are still classics - like Design patterns- this book is 60+% about tricks and issues of C++ compilers circa 1993-94. There are some interesting topics about OOP design (isa/hasa) but they are covered much better by GoF book anyway.
THE first C++ book I’ve read cover to cover, and it does it’s job. The tips and examples are relevant, clear, and informative. Honestly, I think this book was the key factor from taking my skills from beginner to advanced. I only wish there was a single book combining this with Scott Meyers Effective Modern C++, which addresses value forwarding and other goodies in C++14.
Many of the ideas in this book have already been made a part of the c++ "common sense" canon. As a result, a third of the material was superfluous. What was left-over was split into: useful-to-know and "wow this is a cursed c++ feature that I never want to use but I'm glad I know about".
Some people have the approach of learning c++ that requires you to know all c++ developments between 1998 and 2011. I take this approach, but I can't help but feel that there's a more efficient way to gain the knowledge of the gotchas and evolution than reading this book. At least I would suggest skimming the items for ttopic that interest you most, and reading those.
This was read as a part of a professional book-club.
Mandatory prerequisite before reading Effective Modern C++. You also need to refer to Effective Modern C++ alongside this book as some of the items are no longer relevant in C++11+.
If you think you know C++ and you haven't read this book you probably don't actually know C++. Fantastic book - only con is that a lot of points are not as relevant for modern C++ codebases. Would be 5 stars, but ideally this book and Effective Modern C++ would just be merged into one text and drop any pre C++11 discussion.
There is a reason this is considered an essential book by many C++ programmers: It contains many great tips, hints and best practices for working with C++, but it's also written in a way that is not only clear and easy to understand, but also doesn't feel too dry or fatigating to read.
While it's not up to date with C++ standards (the third edition of this book, which I've read, is from 2005), many of the basics here are still well valid today. The author also has a modern C++ book, which I plan to read in the future.
This is an easy recommendation for anyone who wants to work with C++.
Meh, implementation details are never really that interesting. But Meyers has compiled a decent list of items that are specifically stated with accompanying examples to give weight behind his points. This book seems best suited for people with some experience with the language but not too much (~6-12 months), since most of the problems won't really have a whole lot of concrete context before then and after then you'll probably have seen most of these issues yourself.
With some small exceptions (auto_ptr, lack of final classes, etc.), this book is still relevant for modern c++. I think I'm going to print some of the items' titles and have them on my desk at all times - c++ is such a complex language it is easy to misuse it. Useful and light read (for a c++ book).
Still an excellent book. Some of the recommendations might seem obvious, but the explanations given for why you would want to do something, and the sort of pitfalls you can stumble into if you don't, make it valuable. The book is pretty easy to follow, and doesn't require you to be a C++ expert to understand.
It's hard to be fair here because I've known about most of the used techniques. Nevertheless, some things surprised me and illustrating everything with examples are the reasons for a high grade for this book.
A Great book for C++ professional. I would consider this book as a Bible for C++ professionals. The best thing about this book is, it conveys all do(s) and don't(s)in its index and its content covers why we should or shouldn't do. I like the way the book is written.
A little dated and since I have already adopted most of the practices, it felt a little irrelevant. Still, fantastic recommendation with the noobs out there.
Completely essential if you are a C++ programmer. I'd read some of this but decided to revisit it after reading Meyers's "Effective Modern C++" (also a fantastic book).