Live data from Hacker News

Ask HN: Best way to learn modern C++?

news.ycombinator.com

21–30 of 184 posts

Re: Ask HN: Best way to learn modern C++?

#21
Before diving into smart pointers, move semantics and other (mostly) recent additions, I would recommend getting well acquainted with the basics: RAII and common patterns such as passing by constant reference. Effective C++ by Scott Meyers, as others have noted, is an excellent entry point.

Re: Ask HN: Best way to learn modern C++?

#23
post #12

May I ask why do you want to learn modern C++? You should check out Rust, it aims to replace C++ and do a better job in memory management, and developer experience in general (cross-platform compatibility, package management, etc)

>replace C++ No one can replace it, but everyone has to try.

Rust is the first language I've seen that even has a chance though.

Re: Ask HN: Best way to learn modern C++?

#24
post #13

May I ask why do you want to learn modern C++? You should check out Rust, it aims to replace C++ and do a better job in memory management, and developer experience in general (cross-platform compatibility, package management, etc)

Rust still needs to catch up with C++ in a few domains. SIMD, GPGPU, GUI, embedded platforms, iOS, Android, UWP, COM, certified compilers, ...

what do you mean by "certified" compiler here?

Re: Ask HN: Best way to learn modern C++?

#25

IMO, the classic C++ book/author is still the best: Effective C++. Don't forget about the sequels, including the mostly overlooked Effective STL (which I happen to like better than the first two books). And to address the modern part of this question, I'll add that Scott Meyers has written Effective Modern C++ as well, but I'd read that last after getting the hang of C++03. No matter what people say, I tend to believ…

As someone who programmed in "classic C++" for decades, I feel like modern C++ is pretty different, and that it's not just syntactic sugar to make some ugly things easier. The biggest example is that my natural inclination to use raw pointers everywhere and manage all memory myself, while idiomatic modern C++ is full of unique_ptrs and shared_ptrs everywhere, and raw pointers seem to be regarded as a code smell. Converting to this style is not an automatic process.

For people who are coming from a classic C++ background, I find Bancila's Modern C++ Programming Cookbook to be a good first stop for discovering modern C++ idioms.

Re: Ask HN: Best way to learn modern C++?

#26
post #5

Once you've got the basics down from a tutorial (old C++ or modern C++), move on to internalizing all the lessons here: https://isocpp.org/faq (what Marshall Cline's excellent C++ FAQ has become) and here: https://herbsutter.com/gotw/ (Not as organized, but Herb Sutter wrestles with the essential questions of how to deal with the tricky bits of C++) If you've got the cash, read Effective Modern C++ by Scott Meyers. F…

I would like to point out that yosefk fqa is a bit old now, and while some problems mentioned are still relevant, tools and conformity across up to date compilers are magnitudes better now.

Re: Ask HN: Best way to learn modern C++?

#27

May I ask why do you want to learn modern C++? You should check out Rust, it aims to replace C++ and do a better job in memory management, and developer experience in general (cross-platform compatibility, package management, etc)

I'm not the OP, but I'm tempted to learn more C++ so that I can directly use Qt without relying on language bindings for it. I like the idea of Rust, and maybe some day I'll tinker with it, but it looks like it has quite the steep learning curve.

Re: Ask HN: Best way to learn modern C++?

#29
post #24
post #13

Earlier quoted context omitted.

Rust still needs to catch up with C++ in a few domains. SIMD, GPGPU, GUI, embedded platforms, iOS, Android, UWP, COM, certified compilers, ...

what do you mean by "certified" compiler here?

In certain industries, specially where human lives are at stake you can only use certified compilers, where the kind of code they generate is validated against specific safety standards.

For example,

https://www.iar.com/iar-embedded-workbench/certified-tools-f...

Re: Ask HN: Best way to learn modern C++?

#30
post #17

- Tour of C++ ( http://www.stroustrup.com/Tour.html ) - Principles and Practice Using C++ ( http://www.stroustrup.com/programming.html ) - From Mathematics to Generic Programming ( http://www.fm2gp.com/ ) - The Scott Meyers books Some of the Bjarne Stroustrup videos, "Learning and Teaching Modern C++" - https://www.youtube.com/watch?v=fX2W3nNjJIo Some of the Herb Sutter videos, "Writing Good C++14... By Default" - ht…

[deleted]
Post reply on HN