Once upon a time, as I was working on a large project with other C++ programmers, I was asked to set up a series of talks about the language and especially about what has changed since the arrival of C++11. It was in 2020.
So I started to write some slides with what seemed to be the key features from C++11, and quite soon I had to face the truth: it is a lot of content, and there was three additional major updates in the language that should be covered too.
In the end I did not do the talks. However, I kept working on the slides, until eventually I decided to switch the format. It is probably too much material for a talk, but what about a small book?
Hence this document.
The goal is to list many, if not all, essential features introduced in the C++ language since its first well-known deep update, known as C++11, up to the most recent version of the standard, which is C++20 by the time I am writing this.
These features are for the most part presented following a format where the pre-C++11 way is reminded to the reader, with a short explanation of why it may have been problematic or inefficient, then the new way of doing things is presented.
Some parts of the language are silenced, mostly the ones for which I don’t know much, other parts are more thoroughly presented. In any case, this book won’t go into the details and subtleties of any feature, nor into compiler-specific stuff. The reason being mostly time (as far as I can tell I have a limited amount of that in my life) and space (the book is already large enough). The reader is invited to satisfy his curiosity and complete is knowledge by reading other material. For example, the website https://en.cppreference.com has everything we need to know about any feature of the language.
Be advised that some critics may suddenly appear in these pages, about the language or the programmers. Keep in mind that those are personal opinions and may change suddenly!
Finally, a basic knowledge of the language is preferable for the reader to enjoy this book, as some notions will be used without being explained.
While this book is about C++, one should remember that C++ itself is just a tool in the programmer’s toolbox. If you are focusing on learning C++ to become a programmer, a good programmer, I would suggest to rethink your plan and learn programming on a larger scale: computer architecture, algorithms, data structures, project management, packaging, dependency management, coding style, reviews, testing… There are many aspects to be familiar with in the daily life of a programmer, keep some place for them.
As a good starting point, every programmer should read Code Complete [McC04]. This book goes in detail in all aspects of software development, backed up by data coming from over decades of real-life projects, so if you read it you will also gain part of the knowledge from these people who tried, failed, and succeeded before you.
Clean Code [Mar08] is a good second book to read, even though I would not approve all suggestions. For example, it pushes for intensive factorization and the use of object-oriented programming everywhere, which are rather things I have painfully learnt to use parsimoniously. Still, the book is a reference in software development, so you should read it at least to make yourself an opinion and to know what is going on in the business.
Finally, remember that if reading is acquiring the experience of others, practicing is building our own experience. So I strongly recommend to find or start a side project, maybe even a rewrite of existing tools, just to try and get a grasp of the potential underlying complexity.