Jump to ratings and reviews
Rate this book

Effective C++ #4

Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14

Rate this book
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 include:

The pros and cons of braced initialization, noexcept specifications, perfect forwarding, and smart pointer make functions
The relationships among std:: move, std:: forward, rvalue references, and universal references
Techniques for writing clear, correct, effective lambda expressions
How std:: atomic differs from volatile, how each should be used, and how they relate to C++'s concurrency API
How 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

334 pages, Paperback

First published July 1, 2014

Loading interface...
Loading interface...

About the author

Scott Meyers

16 books111 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
884 (63%)
4 stars
413 (29%)
3 stars
80 (5%)
2 stars
12 (<1%)
1 star
1 (<1%)
Displaying 1 - 30 of 111 reviews
Profile Image for Tim Thirion.
9 reviews1 follower
January 8, 2015
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.
Profile Image for Keith Walfson.
14 reviews5 followers
November 16, 2019
It's a good book, a good read. Time well spent, I'm sure i will be using many of the things I learned here in my upcoming projects.
Profile Image for Dmitri.
38 reviews27 followers
February 4, 2015
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.
Profile Image for Sahil Singh.
18 reviews9 followers
June 24, 2020
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?
Profile Image for Sadia Nahreen.
14 reviews9 followers
June 22, 2020
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.
Profile Image for Rene Stein.
191 reviews32 followers
May 18, 2018
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 :) ).
Profile Image for Ondrej Sykora.
Author 3 books12 followers
February 6, 2015
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.
86 reviews2 followers
November 24, 2015
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.
Profile Image for Michael.
99 reviews3 followers
February 2, 2015
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.
August 15, 2019
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.
Profile Image for Mauricio.
35 reviews4 followers
July 23, 2021
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.
Profile Image for Arthur Kipel.
54 reviews1 follower
June 1, 2020
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.
Profile Image for Itai.
88 reviews2 followers
April 25, 2021
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.

Highly recommended for any C++ programmer!
April 24, 2022
Even though the book was written before C++11, most of its contents (focusing on good practices) are still valid today.
52 reviews14 followers
September 20, 2019
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.

* 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

* 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
Profile Image for Ali.
314 reviews2 followers
July 15, 2015
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.
Profile Image for Alex.
44 reviews3 followers
December 19, 2016
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.
Profile Image for Simón.
142 reviews
May 16, 2016
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.
Profile Image for Susan.
117 reviews
January 18, 2021
Did a more detailed reading this time and it's very illuminating!
Profile Image for Alex.
51 reviews10 followers
January 16, 2017
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.
Profile Image for gimpf.
16 reviews1 follower
May 6, 2017
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++.
Profile Image for Foxtrot.
43 reviews
April 1, 2021
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.
Profile Image for Joshua Isaac.
27 reviews1 follower
August 15, 2018
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.
Profile Image for Dmitriy Shilin.
12 reviews3 followers
November 25, 2018
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.
Profile Image for Moritz.
36 reviews2 followers
November 8, 2019
Very good book about how to apply some new features of C++ 11/14. However, as the title already mentions: This is not a book to learn C++ in the first place, its goal is to help people who already know C++ to improve their use of the new features. So this book should be the second or third book you read on C++. It should not be your first. (Speaking from first hand experience)

The book is very informative, very useful and practical and written in a great style. I actually found it to be quite funny from time to time. That is something I did not expect from a book on this topic.

Recommended for everyone already familiar with C++ who wants to further improve.
Profile Image for Jacob.
879 reviews48 followers
February 25, 2019
This is a very good approachable book about the changes that have happened to the C++ language over the last several years, but... it's a book about the changes that have happened to the C++ language over the last 10 years. It's very technical and the nature of the content is dry. The author does a great job making it as interesting as possible, and if you want to develop using the modern features of the C++ programming language, you should read it, but it's still going to be work to read, no matter what. Still glad I read it, though.
Profile Image for Paweł Rusin.
124 reviews2 followers
September 4, 2019
I'm still learning C++ so a lot of this book content went over my head. But it's so interesting to see that "advanced level" may mean different things when it comes to a book on a programming language. For C++ it's all about making the best use of such things as type inference or move semantics, to squeeze every bit of performance from the compiler and the underlying hardware. Not really a book to learn C++, but an amazing resource to expand your mind and a point of reference when fighting with compiler over some cryptic error messages.
Profile Image for Aliaksei Ivanou.
85 reviews2 followers
April 7, 2021
Отличная книга, содержащая много интересных аспектов С++. Книгу стоит не только прочесть, но и перечитывать в дальнейшем при необходимости. Эта книга поможет с пониманием ряда стандартов С++ (C++11 и C++14). Затрагиваются важные темы: интеллектуальные указатели, универсальные ссылки, потоки в С++ и много полезного и необходимого для повседневной работы. Радует, что автор не просто перечисляет возможности языка, но и дает рекомендации о том, когда что использовать нужно и когда, наоборот, не стоит. Книга не самая объемная по тексту, но знаний, советов и рекомендаций тут вагон.
Displaying 1 - 30 of 111 reviews

Can't find what you're looking for?

Get help and learn more about the design.