Settings

Theme

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

32 points by abhimskywalker 3 years ago · 14 comments · 1 min read


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 3 years ago

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.

  • abhimskywalkerOP 3 years ago

    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 :)

pajko 3 years ago

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 3 years ago

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 3 years ago

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.

  • jstx1 3 years ago

    What do you mean by entry level job that financially incentivizes? It seems a bit contradictory.

soheil 3 years ago

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 3 years ago

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

  • frou_dh 3 years ago

    Third Edition just published. I think that's a sign that this is the way to go.

  • pjmlp 3 years ago

    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"

hazyc 3 years ago

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 3 years ago

You sure you want to?

  • abhimskywalkerOP 3 years ago

    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?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection