Coming to grips with C++11 and C++14 is more than a matter of familiarizing yourself with the features they introduce (e.g., auto type declarations, move semantics, lambda expressions, and concurrency support). The challenge is learning to use those features effectively—so that your software is correct, efficient, maintainable, and portable. That’s where this practical book comes in. It describes how to write truly great software using C++11 and C++14—i.e. using modern C++.
Topics
The pros and cons of braced initialization, noexcept specifications, perfect forwarding, and smart pointer make functionsThe relationships among , , rvalue references, and universal referencesTechniques for writing clear, correct, effective lambda expressionsHow differs from volatile, how each should be used, and how they relate to C++'s concurrency APIHow best practices in "old" C++ programming (i.e., C++98) require revision for software development in modern C++Effective Modern C++ follows the proven guideline-based, example-driven format of Scott Meyers' earlier books, but covers entirely new material.
"After I learned the C++ basics, I then learned how to use C++ in production code from Meyer's series of Effective C++ books. Effective Modern C++ is the most important how-to book for advice on key guidelines, styles, and idioms to use modern C++ effectively and well. Don't own it yet? Buy this one. Now".-- Herb Sutter, Chair of ISO C++ Standards Committee and C++ Software Architect at Microsoft
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.
This is how one should write an advanced language tutorial -- as a walkthrough of new language mechanics mixed with both best practices and potential hang-ups.
I've read through this once, but I know I'll continue to use this as a reference as more systems move toward C++11/14.
First of all, if you're involved with C++ in any capacity, you pretty much have to read this book because, to be honest, there isn't much good literature around. Also, ever since the introduction of move semantics, lambdas and other 'advanced' goodies, things got really complicated which means that everyone (and especially people involved with C++ tools or IDEs) now need to know how to deal with the added layers of supposedly necessary complexity.
This little book is Swiss army knife of C++. It's small, concise, and very "effective". One of the tenets of this book is that it doesn't just tell you what you should do without also explaining the underlying mechanics.
Some topics went over my head, and therefore 4 stars instead of 5.
PS: Did you know the animals(animal kingdom) on O'Reilly book covers are all engaged ones?
I see this book as a set of resourceful guidelines for using C++ efficiently for the use case of software engineering. The author focuses not only on performance but very often also on coder’s convenience when it matters during making design/coding decisions. However, this book can not replace a C++ primer book that you should read prior to this in order to know what the author is talking about for several chapters. But even without a primer this book will work just fine as long as you have some experience in working in a C++ codebase that uses C++11/14 features.
Už dlouho jsem se tak nebavil při čtení odborné knihy. Jeden z nejlepších autorů, Scott Meyers, o jednom z nejlepších programovacích jazyků (C++ 11/14). Kniha by se mi hodila už v roce 2011, ale i v roce 2014 je dobré zkonfrontovat své "best practices" se Scottovými doporučeními. Pro lidi, kteří s C++ 11/14 začínají a horko těžko zvládli novou syntaxi, se jedná o povinnou četbu, protože jsou jinak na projektech nepoužitelní (empiricky na některých projektech ověřeno a na těchto projektech nebylo některým lidem ublíženo jen proto, že máme osvícené 21. století a nadbytek deviantních příruček o korektnosti a laskavosti při každém code review :) ).
I'm on a fence. On one hand, Effective Modern C++ is very well written book. Actually, it is clear that the author spent an enormous amount of time perfecting every aspect of the book, including the coloring of the code examples to make the book as good as it can be.
On the other hand, I'm not sure about the target audience - the book is not a reference (or even a textbook) on C++ 11/14, so this is definitely not a book for someone who doesn't know the languages and it even recommends going to study the language reference on some pages. However, for someone who does know the language, most of the tips would be obvious and not as useful.
Man, C++ is ridiculous (fan of straight C and find C++'s craziness hard to swallow at times), but this book is fantastic because it doesn't teach you to program. It shows you what is new in C++ 11. It gives specific action items and patterns to follow when you're coding. Likewise, the book is easy to follow provided that you are familiar with the C++ concepts from previous versions that it uses to explain the new features.
Effective Modern C++ came recommended by a mentor when I asked for recommendations on how to "think in C++". I still am not a C++ convert, but this book fit the bill and I have a better understanding of the language.
Don't read this book if you're expecting simple progressive descriptions of the C++ features. It dives directly into matters, and the book assumes you know almost every single detail about C++. If you're not as experienced as the author, you may find yourself searching the web every minute to understand what he's talking about. On the other hand, if you have a lot of experience with C++ and know about most of its advanced details, I think this book will be great for you. The book is fun, full of jokes, but at the same time depressing. Makes you want to stop using C++ and flee to another programming language.
Recommended for any c++ programmer. Made me really fall in love with the language. I'd almost recommend that a person learn c++ just so they could read this book.
Great book. However, it seems to be for experienced C++ engineers. Every chapter in the book is about some very subtle situation. I feel like I would need to come back to this book later.
Informative yet dense. Some of the chapters were real gems (e.g., all the items on smart pointers), while others covered features I probably won't make use of anytime soon. All of them broadened my awareness of C++ and I feel like I have more tools at my disposal after working through this book.
I would only recommend this to people who already have a solid grasp of the language. The audience for this book is NOT people who are new to C++ and/or want C++11/14 explained to them. It's moreso for people who are already comfortable with C++11/14 and want to dive deeper into how specific parts of the language (that they've probably been using for a while) work. This is probably the most demanding technical book I've read this year so far.
Some of the chapters are really dry, in particular the first two. I think this material was presented first because it's kind of foundational to everything that comes after...but my goodness it was tough to get through at times. (Part of that's my fault for not being familiar enough with the type deduction system in formal discussion...). The remaining chapters were much more enjoyable, for the most part.
Almost every chapter of this book has the following structure: 1. Example of how to use some kind of feature, profit of this feature. Everything clear. 2. How not to use this feature, different side effects. Everything becomes not so obvious. I knew that C++ is rather difficult language which provides possibility to micro-optimize programs, but after reading this book I want to continue using C++ in the most straightforward way, without over-complicated features. Maybe understanding of some C++ concepts will come to me with experience but for now I'm not ready to use it with confidence. So if use-case allows not to use C++ I would like to avoid it.
Clear, concise, full of great examples, and written with humor and flair.
I wish every programming book was this good. While covering advanced topics, only on rare occasions is the subject material tricky or challenging, since the build up of knowledge is gradual and methodical. It is suitable for both novices and experts, and given that the book is divided into distinct "chunks" it is very easy to read a single item or group of items.
I finished this as a part of my work book-club ~5 weeks ago. It's a much more applicable book than the original. The meat is in understanding the implications of r/l-value semantics in all the new constructs. Here is a list of the most important sections from these two books.
EffectiveModernCpp * 5 : prefer auto to explicit type declarations * 7 : distinguish between () and {} when creating objects, prefer {} * 8 : use nullptr instead of null * 9 : prefer using myType=othertype to typedef existingType myType; * 11 : prefer deleted functions to private undefined ones and/or delete functions you don't want * 12 : declare override functions override * 13 : prefer const\_iterators to iterators * 14 : declare functions noexcept if they won't emit an exception * 15 : spam constexpr (I think the need is being reduced in c++20) * 16 : const implies thread-safe, so make const member functions thread safe * 18 : Pretty much use unique\_ptr's instead of pointers * 23 : use std:move on rvalue refs and std::forward on universal refs * 32 : Use init capture to move objects into closures, this also lets you alias them * 33 : `[](auto&& x){ return someCrustyFunction(std::forward(x));}` * 35 : Prefer task-based programming to thread-based, but (36) use an actual async policy
EffectiveCpp * 3 : Use const whenever possible * 4 : Always, always initialize * 14 : Think carefully about copying behavior in resource-managing classes * 19 : Treat class design as type design * 35 : Consider alternatives to virtual functions, like nvi, template patterns, and aggregation * 53 : Use max compiler warnings
A free pre-release edition, that upgraded itself when I was halfway through it.
In short, a survey of the new features available with the newest revisions of C++, along with suggestions on the best ways to use them. Clear and concise, with each item explained so straightforwardly that it is instantly understandable. But with dashes of humor, to give your brain short respites between the avalanches of facts and logic.
I began by reading the book in the proper order, starting with an explanation of template type deduction. (The same that I'd used in the STL in older versions of C++. And now, after all these years, can finally say that I understand.) From there I continued on into the new features. But after a while I realized that there's no reason to read it in order. Each section can stand alone. True, there are references to other sections, but as often as not they're pointing forward in the text rather than backwards. And, in the ebook at least, they come with handy hyperlinks so you can bounce to the reference and then right back. So I started hopping. Straight to the chapter on lambda functions, to see how they could possibly fit well into an OO language. And by gum, it ended up making perfect sense.
I'd definitely recommend this book to old-fart C++ programmers who want to catch up with the new stuff. It's a keeper, if only to dip into from time to time to refresh that feeling of understanding it all.
TL;DR; - Scott Meyer's books about C++ including this one are the best and absolute MUST read for every C++ developer. READ THEM ALL. POINT.
This book series about C++ by Scott Meyers were recognized by many great and famous C++ programmers, such as John Carmack, and in my opinion is the best material about C++ available. The books explain aspects of the language in a very concise and digestible manner while being a huge fun to read in a relaxed, fiction-like way. The C++ is perhaps the most complex and controversial language: some hate it, some consider it a necessary evil and some even manage to see beauty in it. Even though C++ accounts for the most of my day-to-day work, I am still not sure where I am on that map: perhaps somewhere in the middle of the 3 points. John Carmack once said that he believes that a good C++ is better then a good C, so I think these books help defining what a good C++ really is and how to use it effectively and efficiently, while avoiding it's numerous pitfalls. I keep these books on my desk and find myself getting back to them regularly.
This particular book explains all the cool C++11 and C++14 additions to the language. Even though I'm still pre-C++11 professionally and the book was not necessarily useful for my day-to-day work, I still found it very educational and as usual a great fun to read. I'm sure I'll be getting back to it often as well as all other books in the series.
This is a great book for advanced beginners and intermediate C++ programmers. Very concise, bite-sized recipes. I like that you can go as deep as you'd like to: the chapters start simple and go deep.
Great book! An excellent walk through the new features in C++11 and C++14. The rvalue & lvalue and type inference sections are tricky and will require me to visit them again, but the others (introduction to modern features, auto, lambdas, smart pointers and concurrency) were very good.
I probably liked more his Effective C++: maybe the tone in this one is a bit too annoying, but still a great technical book.
I've read this book as supplementary material to an advanced C++ course I'm taking, and I've very much liked it.
The book takes a close look the most important changes from C++ 98 to C++ 11 / 14. Some include:
- move semantics - type deduction - auto deduction - the new smart-pointers - lambdas - etc.
The writing style is very thorough but also pragmatic and pleasant. Given the depth of the content, there aren't many examples, but it felt like there were just enough to follow along. Maybe the course I've taken beside this book was just very good, but there wasn't a point where I couldn't follow along at all.
The only critique I have is that sometimes I would have liked it if the book didn't go as deep, but got onto the next topic quicker to keep me entertained. Although given that the book wants to cover the (at the time) novel features with enough detail to get you up and running, this may not be an entirely fair point. C++ is not an easy language after all.
As of Summer 2023, only very few things aren't up date anymore. The book held up quite well, and most of the content is still very much relevant for C++ 20/23.
Surprisingly, there isn't much comparable material out there, at least not as a nicely currated collection in book-form. I am happy to have read this book and will take it out again if I'm looking for a quick refresher.
I would recommend this book to anyone looking for way to get into the details of some specific Modern C++ areas.
The title says one important thing: This is about C++, and only about updates resulting from the standards 11 and 14 specifically.
It does not supersede the other books from the Modern C++ series. Basics covered in other Books (like exception safety, multiple inheritance, new & delete) will be mentioned when the topic require it, but it refers for in-depth discussions to other resources. That also means that this is not a book you read because you want to get a glimpse into C++ as "an outsider" (say, a C# or Python dev).
But the cover topic, improving C++11/14, it does very nicely. It starts with type-deduction details -- a harsh start, but the topic pays off. Luckily Meyers' Humor gives the book a nice personal touch - the content is dense, and without some dark, twisted humor on the complexity of the beast it would be much harder to read through.
A seasoned C++ dev can definitely skip over some paragrafs, but this book covers many gotchas that most will want to review. Obviously, now is 2017, and most seasoned C++ devs have had their bite already... But in case you are starting out, it's a book that belongs on the shelf of any serious C++.
We have a C++ book club at my workplace and this was the entry when I've joined the party. I have 2 degrees in CS, and Mr. Meyers still had a lot of useful tricks up his sleeves that really surprised me. This is what essentially this book is. As the title suggests, this book contains 42 "tricks" or ways to improve your C++ coding skills. Most of these still hold in the C++17 word, so for the audience of medior - senior(ish) developers this is still a great read. Why I'm hesitant to give it 5 stars is the structure. It adds a lot of simplifications / foreshadowings, especially in the beginning of the book. Talking about the beginning, I think talking about type deduction as the "warm up" of the book can be intimidating to people who are just getting started or to someone who have experience mostly in other languages. Overall still a great read after all these years, and an update to C++17/20 and a bit of restructuring could do wonders.
A demanding & rewarding book. Getting values for the tips proposed in this reference requires being a very capable cpp developer already.
For a cpp noob, its good to skim through it and try to keep the key items summarized at the end of each chapter in mind, so that you can get back to it when you encounter it in a use case.
“The wise man know where to look it up”
It feels like a collection of good stack overflow post answering well crafted questions. I think the advantage of reading this book for someone starting cpp is to get more familiar with the concept of the language to help you articulate your thoughts when you develop in cpp.
As someone coming from python, I found this book very insightful but keep in mind that fresh cpp developer are likely to struggle to take advantage of all the wealth distilled through out the book.
As with the other books in this series, this book is aimed at the hardcore C++ professional who is aiming to squeak every last bit of performance from his code.
As a desktop application developer, I use very little of this in practice. There are some good recommendations on using shared pointers, lambdas, auto, and more. There are also very clear explanations of topics like rvalues and lvalues and std::move and std::forward.
However, there are also long and involved chapters on subjects I'm rarely (if ever!) going to encounter in the wild.
If you want to learn about all the hidden landmines C++ offers, this is a can't miss. If you're looking for a syntax guide on common C++ usage, skip this one.
Very well-written books that grabs almost all new features of modern and effective C++11 and C++14.
Only 4 starts because of the chapter about changes in the thread API (std::thread, std::async, std::atomic and friends). Before this chapter I was admired how the material was organized and structured. But in this chapter there are some strange and very high-level introduction for the thread, story why std::async is better to use then std::thread and etc. I think that we'll be definitely fine without this intro to the thread fundamentals because many of us had to deal with thread somehow before the C++11 was officially released. BTW if you omit my little nitpick about this chapter the book is worth to read.