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

32 points by abhimskywalker ↗ HN
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++?

14 comments

[ 0.18 ms ] story [ 44.7 ms ] thread
You sure you want to?
What else would you recommend? Rust?

But if I have to work with hardware, I believe even today (and perhaps for many years to come) C/C++ is the way to go right?

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.

What do you mean by entry level job that financially incentivizes? It seems a bit contradictory.
I would start with Stroustrup's A Tour of C++.
Third Edition just published. I think that's a sign that this is the way to go.
I second it, and on top of that follow Bjarne's advice regarding static analysis and the C++ Core Guidelines.

Additionally have a look at,

"Beautiful C++: 30 Core Guidelines for Writing Clean, Safe, and Fast Code"

"Embracing Modern C++ Safely"

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.

Thanks!

This sounds like a great advice! Will pickup a domain and get started. Would probably look around for hardware/robotics and machine learning domain specific projects to get started and learn :)

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.
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.