The Definitive C++ Book Guide and List

Created 23.12.2008 05:23
Viewed 2.59M times
4235 votes

This question attempts to collect the few pearls among the dozens of bad C++ books that are published every year.

Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written C++ book. It is way too big and complex for doing this. In fact, it is so big and complex, that there are very many very bad C++ books out there. And we are not talking about bad style, but things like sporting glaringly obvious factual errors and promoting abysmally bad programming styles.

Please edit the accepted answer to provide quality books and an approximate skill level — preferably after discussing your addition in the C++ chat room. (The regulars might mercilessly undo your work if they disagree with a recommendation.) Add a short blurb/description about each book that you have personally read/benefited from. Feel free to debate quality, headings, etc. Books that meet the criteria will be added to the list. Books that have reviews by the Association of C and C++ Users (ACCU) have links to the review.

*Note: FAQs and other resources can be found in the C++ tag info and under c++-faq.

0
Answers 1
36
5274

Beginner

Introductory, no previous programming experience

  • C++ Primer * (Stanley Lippman, Josée Lajoie, and Barbara E. Moo) (updated for C++11) Coming at 1k pages, this is a very thorough introduction into C++ that covers just about everything in the language in a very accessible format and in great detail. The fifth edition (released August 16, 2012) covers C++11. [Review]

    * Not to be confused with C++ Primer Plus (Stephen Prata), with a significantly less favorable review.

  • Programming: Principles and Practice Using C++ (Bjarne Stroustrup, 2nd Edition - May 25, 2014) (updated for C++11/C++14) An introduction to programming using C++ by the creator of the language. A good read, that assumes no previous programming experience, but is not only for beginners.

Introductory, with previous programming experience

  • A Tour of C++ (Bjarne Stroustrup) (2nd edition for C++17) The “tour” is a quick (about 180 pages and 14 chapters) tutorial overview of all of standard C++ (language and standard library, and using C++11) at a moderately high level for people who already know C++ or at least are experienced programmers. This book is an extended version of the material that constitutes Chapters 2-5 of The C++ Programming Language, 4th edition.

  • Accelerated C++ (Andrew Koenig and Barbara Moo, 1st Edition - August 24, 2000) This basically covers the same ground as the C++ Primer, but does so on a fourth of its space. This is largely because it does not attempt to be an introduction to programming, but an introduction to C++ for people who've previously programmed in some other language. It has a steeper learning curve, but, for those who can cope with this, it is a very compact introduction to the language. (Historically, it broke new ground by being the first beginner's book to use a modern approach to teaching the language.) Despite this, the C++ it teaches is purely C++98. [Review]

Best practices

  • Effective C++ (Scott Meyers, 3rd Edition - May 22, 2005) This was written with the aim of being the best second book C++ programmers should read, and it succeeded. Earlier editions were aimed at programmers coming from C, the third edition changes this and targets programmers coming from languages like Java. It presents ~50 easy-to-remember rules of thumb along with their rationale in a very accessible (and enjoyable) style. For C++11 and C++14 the examples and a few issues are outdated and Effective Modern C++ should be preferred. [Review]

  • Effective Modern C++ (Scott Meyers) This is basically the new version of Effective C++, aimed at C++ programmers making the transition from C++03 to C++11 and C++14.

  • Effective STL (Scott Meyers) This aims to do the same to the part of the standard library coming from the STL what Effective C++ did to the language as a whole: It presents rules of thumb along with their rationale. [Review]


Intermediate

  • More Effective C++ (Scott Meyers) Even more rules of thumb than Effective C++. Not as important as the ones in the first book, but still good to know.

  • Exceptional C++ (Herb Sutter) Presented as a set of puzzles, this has one of the best and thorough discussions of the proper resource management and exception safety in C++ through Resource Acquisition is Initialization (RAII) in addition to in-depth coverage of a variety of other topics including the pimpl idiom, name lookup, good class design, and the C++ memory model. [Review]

  • More Exceptional C++ (Herb Sutter) Covers additional exception safety topics not covered in Exceptional C++, in addition to discussion of effective object-oriented programming in C++ and correct use of the STL. [Review]

  • Exceptional C++ Style (Herb Sutter) Discusses generic programming, optimization, and resource management; this book also has an excellent exposition of how to write modular code in C++ by using non-member functions and the single responsibility principle. [Review]

  • C++ Coding Standards (Herb Sutter and Andrei Alexandrescu) “Coding standards” here doesn't mean “how many spaces should I indent my code?” This book contains 101 best practices, idioms, and common pitfalls that can help you to write correct, understandable, and efficient C++ code. [Review]

  • C++ Templates: The Complete Guide (David Vandevoorde and Nicolai M. Josuttis) This is the book about templates as they existed before C++11. It covers everything from the very basics to some of the most advanced template metaprogramming and explains every detail of how templates work (both conceptually and at how they are implemented) and discusses many common pitfalls. Has excellent summaries of the One Definition Rule (ODR) and overload resolution in the appendices. A second edition covering C++11, C++14 and C++17 has been already published. [Review]

  • C++ 17 - The Complete Guide (Nicolai M. Josuttis) This book describes all the new features introduced in the C++17 Standard covering everything from the simple ones like 'Inline Variables', 'constexpr if' all the way up to 'Polymorphic Memory Resources' and 'New and Delete with overaligned Data'. [Review]

  • C++ in Action (Bartosz Milewski). This book explains C++ and its features by building an application from ground up. [Review]

  • Functional Programming in C++ (Ivan Čukić). This book introduces functional programming techniques to modern C++ (C++11 and later). A very nice read for those who want to apply functional programming paradigms to C++.

  • Professional C++ (Marc Gregoire, 5th Edition - Feb 2021) Provides a comprehensive and detailed tour of the C++ language implementation replete with professional tips and concise but informative in-text examples, emphasizing C++20 features. Uses C++20 features, such as modules and std::format throughout all examples.


Advanced

  • Modern C++ Design (Andrei Alexandrescu) A groundbreaking book on advanced generic programming techniques. Introduces policy-based design, type lists, and fundamental generic programming idioms then explains how many useful design patterns (including small object allocators, functors, factories, visitors, and multi-methods) can be implemented efficiently, modularly, and cleanly using generic programming. [Review]

  • C++ Template Metaprogramming (David Abrahams and Aleksey Gurtovoy)

  • C++ Concurrency In Action (Anthony Williams) A book covering C++11 concurrency support including the thread library, the atomics library, the C++ memory model, locks and mutexes, as well as issues of designing and debugging multithreaded applications. A second edition covering C++14 and C++17 has been already published. [Review]

  • Advanced C++ Metaprogramming (Davide Di Gennaro) A pre-C++11 manual of TMP techniques, focused more on practice than theory. There are a ton of snippets in this book, some of which are made obsolete by type traits, but the techniques, are nonetheless useful to know. If you can put up with the quirky formatting/editing, it is easier to read than Alexandrescu, and arguably, more rewarding. For more experienced developers, there is a good chance that you may pick up something about a dark corner of C++ (a quirk) that usually only comes about through extensive experience.

  • Large Scale C++ volume I, Process and architecture (John Lakos). Part one of a three part series extending the older book 'Large Scale C++ Design'. Lakos explains battle tested techniques to manage very big C++ software projects. If you work in big C++ software project this is a great read, detailing the relation between physical and logical structure, strategies for components and their reuse.


Reference Style - All Levels

  • The C++ Programming Language (Bjarne Stroustrup) (updated for C++11) The classic introduction to C++ by its creator. Written to parallel the classic K&R, this indeed reads very much like it and covers just about everything from the core language to the standard library, to programming paradigms to the language's philosophy. [Review] Note: All releases of the C++ standard are tracked in the question "Where do I find the current C or C++ standard documents?".

  • C++ Standard Library Tutorial and Reference (Nicolai Josuttis) (updated for C++11) The introduction and reference for the C++ Standard Library. The second edition (released on April 9, 2012) covers C++11. [Review]

  • The C++ IO Streams and Locales (Angelika Langer and Klaus Kreft) There's very little to say about this book except that, if you want to know anything about streams and locales, then this is the one place to find definitive answers. [Review]

C++11/14/17/… References:

  • The C++11/14/17 Standard (INCITS/ISO/IEC 14882:2011/2014/2017) This, of course, is the final arbiter of all that is or isn't C++. Be aware, however, that it is intended purely as a reference for experienced users willing to devote considerable time and effort to its understanding. The C++17 standard is released in electronic form for 198 Swiss Francs.

  • The C++17 standard is available, but seemingly not in an economical form – directly from the ISO it costs 198 Swiss Francs (about $200 US). For most people, the final draft before standardization is more than adequate (and free). Many will prefer an even newer draft, documenting new features that are likely to be included in C++20.

  • Overview of the New C++ (C++11/14) (PDF only) (Scott Meyers) (updated for C++14) These are the presentation materials (slides and some lecture notes) of a three-day training course offered by Scott Meyers, who's a highly respected author on C++. Even though the list of items is short, the quality is high.

  • The C++ Core Guidelines (C++11/14/17/…) (edited by Bjarne Stroustrup and Herb Sutter) is an evolving online document consisting of a set of guidelines for using modern C++ well. The guidelines are focused on relatively higher-level issues, such as interfaces, resource management, memory management and concurrency affecting application architecture and library design. The project was announced at CppCon'15 by Bjarne Stroustrup and others and welcomes contributions from the community. Most guidelines are supplemented with a rationale and examples as well as discussions of possible tool support. Many rules are designed specifically to be automatically checkable by static analysis tools.

  • The C++ Super-FAQ (Marshall Cline, Bjarne Stroustrup and others) is an effort by the Standard C++ Foundation to unify the C++ FAQs previously maintained individually by Marshall Cline and Bjarne Stroustrup and also incorporating new contributions. The items mostly address issues at an intermediate level and are often written with a humorous tone. Not all items might be fully up to date with the latest edition of the C++ standard yet.

  • cppreference.com (C++03/11/14/17/…) (initiated by Nate Kohl) is a wiki that summarizes the basic core-language features and has extensive documentation of the C++ standard library. The documentation is very precise but is easier to read than the official standard document and provides better navigation due to its wiki nature. The project documents all versions of the C++ standard and the site allows filtering the display for a specific version. The project was presented by Nate Kohl at CppCon'14.


Classics / Older

Note: Some information contained within these books may not be up-to-date or no longer considered best practice.

  • The Design and Evolution of C++ (Bjarne Stroustrup) If you want to know why the language is the way it is, this book is where you find answers. This covers everything before the standardization of C++.

  • Ruminations on C++ - (Andrew Koenig and Barbara Moo) [Review]

  • Advanced C++ Programming Styles and Idioms (James Coplien) A predecessor of the pattern movement, it describes many C++-specific “idioms”. It's certainly a very good book and might still be worth a read if you can spare the time, but quite old and not up-to-date with current C++.

  • Large Scale C++ Software Design (John Lakos) Lakos explains techniques to manage very big C++ software projects. Certainly, a good read, if it only was up to date. It was written long before C++ 98 and misses on many features (e.g. namespaces) important for large-scale projects. If you need to work in a big C++ software project, you might want to read it, although you need to take more than a grain of salt with it. Not to be confused with the extended and later book series Large Scale C++ volume I-III.

  • Inside the C++ Object Model (Stanley Lippman) If you want to know how virtual member functions are commonly implemented and how base objects are commonly laid out in memory in a multi-inheritance scenario, and how all this affects performance, this is where you will find thorough discussions of such topics.

  • The Annotated C++ Reference Manual (Bjarne Stroustrup, Margaret A. Ellis) This book is quite outdated in the fact that it explores the 1989 C++ 2.0 version - Templates, exceptions, namespaces and new casts were not yet introduced. Saying that however, this book goes through the entire C++ standard of the time explaining the rationale, the possible implementations, and features of the language. This is not a book to learn programming principles and patterns on C++, but to understand every aspect of the C++ language.

  • Thinking in C++ (Bruce Eckel, 2nd Edition, 2000). Two volumes; is a tutorial style free set of intro level books. Downloads: vol 1, vol 2. Unfortunately they're marred by a number of trivial errors (e.g. maintaining that temporaries are automatically const), with no official errata list. A partial 3rd party errata list is available at http://www.computersciencelab.com/Eckel.htm, but it is apparently not maintained.

  • Scientific and Engineering C++: An Introduction to Advanced Techniques and Examples (John Barton and Lee Nackman) It is a comprehensive and very detailed book that tried to explain and make use of all the features available in C++, in the context of numerical methods. It introduced at the time several new techniques, such as the Curiously Recurring Template Pattern (CRTP, also called Barton-Nackman trick). It pioneered several techniques such as dimensional analysis and automatic differentiation. It came with a lot of compilable and useful code, ranging from an expression parser to a Lapack wrapper. The code is still available online. Unfortunately, the books have become somewhat outdated in the style and C++ features, however, it was an incredible tour-de-force at the time (1994, pre-STL). The chapters on dynamics inheritance are a bit complicated to understand and not very useful. An updated version of this classic book that includes move semantics and the lessons learned from the STL would be very nice.

23.12.2008 05:52
Comments
@G Rassovsky: All books which promise to teach X in Y hours. For example Learn C++ in 24 hours. I believe all such books are better avoided. by akhil_mittal, 29.12.2014 04:47
I hate to step on anybody's shoes, but I do not recommend Bruce Eckel's "Thinking in C++" even though I respect the author for publishing his materials online for free. The book's perspective suggests relatively poor or ineffective use of C++ and "object oriented" programming, akin to poor application of the GoF Design Patterns. I found it an interesting introductory book to programming in general, but as someone becomes more familiarized with programming and (especially) computer science as a whole, I find books which think purely in "classic" OOP terms detrimental to education. by User, 16.01.2015 05:55
@G.Rassovsky on the accu.org website, there's a book reviews section with ratings. You can search for the C++ ones. Many of them are rated "not recommended". by Zaphod Beeblebrox, 26.01.2016 21:58
Accelerated C++ is from 2000. Should I worry that it's out of date? by AutonomousApps, 23.04.2016 15:58
I think it would be good to put the dates published for the edition (with the edition number where applicable). by Aaron Hall, 26.06.2017 17:48
Do any of these books other than "C++ Concurrency In Action" go into detail about threading applications? Just curious as this is a topic I really want to learn the ins and outs of and can be pretty daunting at times. (Not implying C++ Concurrency In Action is bad, haven't read it, just looking for as many good sources as possible). by Chris, 14.05.2018 16:19
@Anonymousapps Accelerated C++ is from 2000 and is still relevant. by Lyle S., 27.06.2018 20:00
Does every edition of "The C++ programming language" from Stroustrup replace the previous one completely? And what about "A tour of C++"? It's entry in this list just says that the 2nd edition is for C++17, not specifying if it's a complement to the first one with the new features or it's a completely updated version. I wanted to get A Tour of C++ to get started and I'm unsure if the 2nd edition is a good pick. by Eärendil Baggins, 11.11.2018 15:59
@Chris "C++ Concurrency in Action" is quite good, but extremely heavy. So for a start indeed something more basic would be much better. by BartoszKP, 26.11.2018 09:15
Hi...I added C++17 - The Complete Guide to the list...the author is Nicolai M. Josuttis (who everyone knows as one of the authors of C++ Templates)....the book is not listed on Amazon and Josuttis is offering it up on LeanPub in a 'pay what you think it is worth' model...thought putting it here may help him....as far as the book review is concerned, there aren't any and I have only read a couple of chapters and the impression so far is 'very good' by MS Srikkanth, 15.12.2018 14:20
Many of the links in this question are blocked by uBlockOrigin :( by Johannes Schaub - litb, 15.12.2018 14:54
If I try to order these books using these links, instead of going to the Amazon homepage and manually search for them, do I get a discount? Is this like affiliate links or something? The reason why I'm asking is because I see that the list price on some of these is strike through in favor of a new cheaper list price. by Galaxy, 13.06.2019 02:48
@Galaxy When I hover my mouse over the first link, I see "rads.stackoverflow.com/amzn/click/com/0321714113". by Sparky, 03.07.2019 21:13
@EärendilBaggins A Tour of C++, 2nd edition is a nice and compact book. Just read it myself. by jozols, 04.07.2019 09:11
Why is "Mastering the C++17 STL" in the "Old/Outdated" section? For me, that is an error. by LeDYoM, 13.07.2019 19:42
What are some good "Data Structures and Algorithms in C++" undergrad CS level books? I took this course in Java and want to redo it in C++ according to best practices. by mLstudent33, 26.07.2019 17:41
@mLstudent33 I would suggest just registering for a competitive programming website and see that you can apply what you know so far. Make a list of things that you want to learn and solve problems specific to a topic. by piepi, 01.08.2019 13:07
@piepi, is hackerrank sufficient? I remember being stuck on the problem where you had to input an integer sequence as a string. But it's enjoyable. by mLstudent33, 01.08.2019 14:05
It should be noted that C++ Primer is getting a bit long in the tooth now, and a lot have happened since it was written. There are also quite a few small errors and even bugs in the code examples that haven't been addressed by the authors (there's no public errata). by Some programmer dude, 13.09.2019 08:43
C++ in Action book by Bartosz Milewski is great book. by Bharat, 05.10.2019 10:19
@Someprogrammerdude Do you recommend any other books that are updated? by User, 29.12.2019 03:28
@FuzzySquid It's still a decent book, and there's apparently a new edition on the way. And the rest of the books are still good. by Some programmer dude, 29.12.2019 10:23
The newest edit (before my edit) reeks of self-promotion. I have not read the book promoted and thus have no strong opinion on it but by default, I would prefer readers and developers to contribute rather than authors. I therefore reverted the change but am open to hearing other opinions in this regard. by Hagadol, 27.01.2020 13:25
@Hagadol Actually, my greatest concern about that book (which I don't know either) is that it is about C. by Bob__, 27.01.2020 14:19
am not sure is it necessary to study these book , i think its good to jump in coding directly and learn as you code , you can learn basic c++ in 10 min just from wikipedia go through its basic syntax that how its variables are declare and who basic if checks and control loops etc and start coding . you will get better as you code more. by user889030, 24.02.2020 07:13
Pretty much standard list. Lakos is not worth it needing 400 pages for the pimpl idiom trick. Langer is more a reference which is pity since iostream is vast topic. @Chris: perhaps Butenhof's book. It explains condition variables, barriers and a work queue though it uses POSIX threads (which are translatable to C++ threads). at user889030: no if you don't read books you learn yourself the wrong things. C++ is a programming language full of pitfalls. by gast128, 03.03.2020 10:21
Can anyone throw in any good ones for C++ 20? It would be quite helpful :) by kesarling, 04.08.2020 06:49
@d4rkang31 Rainer Grimm's "Modernes C++" blog features a number of articles about C++20 modernescpp.com by Den-Jason, 20.08.2020 18:31
Which book is good to learn about new features in C++11 and 14, like move semantics etc.? I started with C++98, then switched to C for several years, now I'm going to switch to C++ again so I need some introduction :) by xba, 02.10.2020 14:04
My textbook teaching C++17 (and Fortran2008) for engineering type students. Feel free to add. web.corral.tacc.utexas.edu/CompEdu/pdf/isp by Victor Eijkhout, 12.11.2020 14:38
I think this is also a good reference: docs.microsoft.com/en-us/cpp/cpp/… by Aditya Singh Rathore, 11.03.2021 07:44
Can someone please tell me if these books are up to date? by Edison Pebojot, 12.03.2021 05:10
I am reading Programming: Principles and Practice Using C++, 2014 and I hate it! It is organized almost completely back-asswards. To be clear, I trust that the content is "Not Wrong," and that it espouses correct programming technique simply because the author invented C++. But that does not mean he knows how to explain it. The first third of almost every section describes something completely unrelated to the topic stated in the heading. A huge proportion of the examples use at least some syntax that has not yet been explained. This creates lots of needless cognitive overload. by GrantRobertson, 13.03.2021 15:45
Just a little adition: I find "C++ High Performance" by Andrist/Sehr extremely useful and well-written! It doesn't cover the very basics, but everything intermediate and beyond is covered very nicely (like move semantics, STL containers, concurrency). by jacques, 21.03.2021 02:30
Looking for a C++20 book that covers Coroutine, Concepts, Ranges & modules in detail. by Vencat, 28.03.2021 21:42
@GrantRobertson C++ isn't an easy language to learn, & to use C++ as a vehicle to teach programming to a beginner is nightmarish. IMO Stroustrup's book, Programming:Principles and Practice shouldn't be recommended to absolute beginners. Having tried to learn C++ using it and been greatly disappointed, IMO you can't combine teaching the "essence" of programming or what programming "really is about" (things like recursion) with teaching a language with one of the most complicated and unintuitive (to beginners) syntaxes. The syntax & rules inevitably get in the way of the "bigger picture" by tf3, 10.04.2021 04:38
Show remaining 31 comments