Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Best path/resource to learn modern C++ in 2022?
32 points by abhimskywalker on Sept 21, 2022 | hide | past | favorite | 14 comments
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++?




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


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


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


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.


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.


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.


This sounds great!


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"


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.


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?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: