HACKER Q&A
📣 abhimskywalker

Best path/resource to learn modern C++ in 2022?


Having searched multiple places, it seems there are mixed opinions on best way to start learning C++ across time and internet forums.

For experienced programmers (Python, JS, Java, Kotlin, etc.), what's the best way to pickup modern C++?

What are best resources you have come across for C++?


  👤 maldev Accepted Answer ✓
You need to choose a domain. Find software and libraries in that domain and then work off of that. "Modern C++" can mean alot of things. Most people conflate this with the STD library, but alot of people don't use that. Core language feature wise it's not that much. Some "Modern" c++ domains don't even use the STD.

This is similar to asking "What is the best way to learn modern Java", where the answer will vary vastly based off what whether you're doing embedded, desktop, server, serverless, websites etc.

Possibilities for "modern" C++ domains. HPC, Machine Learning, Finance, Gamedev, Crypto, Scientific... Also keep in mind most are going to be writing C with Classes and target C++11 at most.


👤 pajko
http://tmplbook.com/ and study the source code of some good-quality open source project, for example https://github.com/fmtlib/fmt/

and this could be also handy: https://en.cppreference.com/w/cpp/meta


👤 nbaksalyar
C++ Crash Course [0] should be a good start. It will teach you all the important basics without the legacy stuff.

[0] https://nostarch.com/cppcrashcourse


👤 scombridae
For experienced programmers

Start with getting an entry-level job doing C++, which 1. financially incentivizes, and 2. gives you something concrete to work off of. I am an experienced programmer.


👤 soheil
Dive into a project like Firefox, build it on your platform, then focus on a component that you can visually test, start hacking, make silly changes and just go to town.

👤 AnimalMuppet
I would start with Stroustrup's A Tour of C++.

👤 hazyc
If you want a thorough reference of C++20 and enjoy 1000 page textbooks (I do), then I can recommend 'Professional C++' by Marc Gregoire.

👤 PaulHoule
You sure you want to?