Resources that help you to delve into C++
I already received some great feedback 1 for this post, and any further feedbacks, error-correction, and resource recommendation are welcome. One way to contact me is to direct message me (@Lesleylai6) on Twitter.
Update 2021-03-29: Add a bunch of resources.
During the years, a lot of people ask me for help in learning C++. I am no C++ expert, but as a person who is doing C++ for years, I want to share a bunch of beginner-friendly C++ resources that are known to be of high quality. And hopefully this list of resources can help learners who are new to C++.
When anyone asks me for guidance about getting into C++, I always ask first about their existing experiences. Some people just start to learn programming and decide to learn C++ as their first language, some people have learned a limited amount of C++ and want to learn more, and some of them are already programming veterans in other languages. Depend on your experiences, you probably want to start with different materials, and I try to cater to each of those backgrounds in this post.
One thing I want to mention, though, is that reading books or watching videos all the time is not the best strategy to learn. Whatever stage you are in, it is much easier to learn when you apply ideas into code, so spending time on coding projects helps.
For beginners, it is important to only "learn from the best" since it is hard to discern if your tutorial is making mistakes or encouraging bad practices.
For books, I recommend Bjarne Stroustrup (the creator of C++) 's "Programming: Principles and Practice Using C++ 2nd edition" as a starting point. The book is thick, so don't feel guilty if you cannot finish the whole book.
What if you have some limited C++ experience before? Maybe you already learned some C++ from your university data structure course, or perhaps you followed some online tutorials that use C++. From my personal experiences and what I heard, most university programming courses or those online tutorials teach problematic practices, and the instructors often do not have a good grasp of the language. Thus, "learn from the best materials" is especially important for you to offset prior misconceptions on C++.
For books, I will still recommend either Bjarne Stroustrup's "Programming: Principles and Practice Using C++ 2nd edition". And for video tutorials, you can try Kate Gregory's C++ Fundamentals Including C++ 17.
If you are already a proficient programmer in some other languages and want to delve into C++, you can choose materials with faster pace.
As for book recommendations, Bjarne Stroustrup's "The C++ Programming Language (4th Edition)" was one of the best-written books I ever read, though do notice that this book was written with C++11 and misses some of the later developments. The book is also very thick, so if you want a shorter introduction, try "A Tour of C++ (Second edition)".
So you spend months with the above materials, and feel that you have a decent grasp of basic C++ concepts.
A sanity check to make sure about your understanding of C++ is whether you are familiar with the following topics, to name a few:
- how to use
- references and pointers
- usage of the standard library, in particular, iterators and algorithms
- copy and move constructor and assignment
- move semantics
- operator overloading
- lambda expressions and function objects
- undefined behaviors
Now it is time to put C++ into practical usage. C++ is used for diverse purposes, and using C++ in specific areas is probably more critical than the C++ language itself. It is perhaps also a good time to spend some time on the broader C++ ecosystems, like testing libraries such as Catch2, build system generators such as CMake, and package managers such as Conan or vcpkg.
That being said, there is still a lot to learn about the C++ language itself. And I will try to list some resources that are still relative up-to-date and I enjoyed:
If you haven't read "The C++ Programming Language (4th Edition)", I would still recommend it. And here is a bunch of other books I would like to recommend:
- "Effective Modern C++" by Scott Mayer
- "C++ Best Practices" by Jason Turner
- "C++17 - The Complete Guide" by Nicolai M. Josuttis
Some books focus on specific areas of the language, such as:
- "C++ Templates - The Complete Guide, 2nd Edition" by David Vandevoorde, Nicolai M. Josuttis, and Douglas Gregor
- "Mastering the C++17 STL" by Arthur O'Dwyer
- "Functional Programming in C++" by Ivan Čukić
- "C++ Concurrency in Action, 2nd edition" by Anthony Williams
Conference videos are also an excellent resource to learn more about C++. They focus on a diversity of topics; many of them are hard to find in books. And they also require low commitment (just spend an hour lunchtime watching some videos)
Here are some of my favorites that are also beginner-friendly:
- CppCon 2019: Kate Gregory "Naming is Hard: Let's Do Better"
- CppCon 2018: Kate Gregory "Simplicity: Not Just For Beginners"
- CppCon 2017: Kate Gregory "10 Core Guidelines You Need to Start Using Now"
- CppCon 2017: Matt Godbolt "What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid"
- Going Native 2013: Sean Parent "C++ Seasoning"
- CppCon 2014: Herb Sutter "Back to the Basics! Essentials of Modern C++ Style"
- CppCon 2015: Bjarne Stroustrup “Writing Good C++14”
- CppCon 2018: Jason Turner "Applied Best Practices"
- CppCon 2017: Jason Turner “Practical C++17”
Many people in the C++ community, and I am always willing to answer direct messaging questions. However, I, or most people you can contact online, have limited experiences.
To utilize the best wisdom of people, you need to join programming communities, and then you can ask questions in public and get a response from multiple people. 2
Being active in programming communities also has numerous other benefits, including getting job information and having more social support.
#include<C++> is a wonderful community to join. Its mission includes providing conference scholarship to people in need, but for most people, you can join its discord server to hang out and talk about C++.
Joining North Denver Metro C++ Meetup was one of the best decisions for me during my college years. I understand that it is a hard time to pop into meetups at the time of writing since most of them are currently held online. Nevertheless, I urge you to try to attend some meetups if you have time. Online meetings also provide some advantages compare to physical ones. For example, they require low commitment, and you can choose from all of those meetups worldwide.
If you are serious about C++, then conferences are great places to meet like-minded people. There are C++ conferences around the globe.
Same as meetups, one difficulty at the time of writing is that most C++ conferences are hosted online, but they are still worthwhile to consider. Here are some of the recurring C++ conferences or conferences that heavily feature C++, with their Twitter handle and Youtube Channel:
- CppCon (@CppCon) [Youtube] (U.S.-based)
- C++Now (@cppnow) [Youtube] (U.S.-based, tuned toward a more advanced audience)
- ACCU (@ACCUConf) [Youtube] (UK-based, different programming languages, but has a lot of C++ contents)
- Meeting C++ (@meetingcpp) [Youtube] (German-based)
- emBO++ (@emBO++) [Youtube] (German-based)
- Pacific++ (@pacificplusplus) [Youtube] (Australia-based)
- C++ on Sea (@cpponsea) [Youtube] (UK-based)
- Core C++ (@corecpp) [Youtube] (Israel-based)
- Code::Dive (@code_dive_pl) [Youtube] (Poland-based)
- Code Europe (@code_europe) [Youtube] (Poland-based, different programming languages)
- NDC Conferences (@NDC_Conferences) [Youtube] (Multiple locations, different programming languages) 3
There is a list of conferences on the ISO C++ website.
There are a bunch of C++ podcasts, including a few new ones appeared in 2020:
I use RSS to keep track of the tech blogs, and I highly recommend you try out RSS too.
I follow hundreds of blogs 4, including C++ and various other topics. Here are some of the best C++ ones that pops into my head:
- Fluent C++
- Arthur O’Dwyer
- Sutter’s Mill
- Modernes C++
- The Pasture
- Barry Revzin
- Bartek's coding blog
- Simplify C++
- Video Cortex
- Shafik Yaghmour
Do notice that blogs sometimes can talk about very advanced topics.
It is your personal preference on whether to join Twitter or not. On the one hand, Twitter is a great platform to directly communicate with the programming communities and know what other people are up to. And personally, Twitter is the platform that I know so many exciting developers worldwide. On the other hand, Twitter has its downside with all the procrastinating and doomscrolling. Some tweets you see can also make you upset. My suggestion is to try Twitter out at least, and you can quit if it doesn't work for you.
Here are some misc resources that are also worth mentioning. Some of those are great online tools, while others are video series.
- cppreference should be your go-to site for C++ language and standard library reference, and it is usually a lot more accurate and up-to-date than its alternatives.
- Compiler Explorer is an online coding environment that supports C++ and a dozen other languages. It can show the compiled assembly of your program and run your program. Unlike most online C++ coding environments, which often ship with an outdated compiler, there are many compilers to choose from in compiler explorer, including the most cutting-edge ones.
- Quick C++ benchmark is an online tool to perform quick benchmarks on C++.
- C++ Insights is an invaluable tool to show how compilers translation "syntactic sugar" such as lambda expressions and range-based for-loop behind the scenes. I used it in my C++ lambda tutorial post.
- C++ Tips of the week
- Kate Gregory's STL Algorithms course is a great resource to learn more about and appreciate C++ standard algorithms.
- C++ Weekly is a Youtube channel on various C++ topics, posted weekly.
- "SG20 Education And Recommended Videos For Teaching C++". Christopher Di Bella, 2021, https://www.cjdb.com.au/sg20-and-videos. Accessed 15 Jan 2021.
- "References And Links". #Include ＜C++＞, 2021, https://www.includecpp.org/resources/references/. Accessed 16 Jan 2021.
- Yaghmour, Shafik. "Where To Get Started Learing C++ And What Resources To Use". Shafik Yaghmour's Blog, 2019, https://shafik.github.io/c++/learning/2019/09/05/getting_started_learning_cpp.html. Accessed 16 Jan 2021.
- Thanks to Shafik Yaghmour, Kate Greogory, and Dwight Browne.↩
- Asking questions online is an art, and a poorly phrased question makes people don't know how to respond. Further, people are often too polite to point out that a question is poorly phrased. Kate Gregory's How to ask for C++ coding help is an excellent read on how to ask for help online.↩
- Some of the links above are collected from shafik/cpp_youtube_channels↩
- If you want to see all the blogs I follow, visit this gist.↩