Live data from Hacker News

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

news.ycombinator.com

1–10 of 184 posts

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

#1
Do you have some good advice or know any useful resources to learn in a proper way how to code in C++? For the context, I know some C, but C++ seems a different kind of beast, and it's easy to get lost in the huge variety of features and libraries it offers.

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

#3
Also in case anyone is going to suggest something project-like please something in the direction of HFT/OS/Systems related as opposed to game programming? There are loads of stuff out there for C++ related to game programming.

For OP: https://stackoverflow.com/questions/388242/the-definitive-c-...

Also some C++ related YT channels such as TheChernoProject, CppCon etc

Following the respective reddit and slack communities is also extremely helpful.

Also get your hands dirty with this: https://github.com/vitalets/github-trending-repos

or https://github.com/fffaraz/awesome-cpp There is more but this should do.

Oh I almost forgot: https://ishansharma.github.io/twitter-mentors/ http://stephaniehurlburt.com/blog/2016/11/14/list-of-enginee... https://twitter.com/sehurlburt/status/889004724669661184

Good Luck! :-)

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

#4
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 believe C++11 and on is not really a different language as much as it is syntactic sugar to cover up the ugliest parts of C++.

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

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

Finally, if you're ready to snark at all you've learned, read the C++ FQA:

http://yosefk.com/c++fqa/

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

#7
Read Stroustrup's blue book (The C++ Programming Language 4th edition); chapter 1 will teach you a LOT.

Then read Meyer's Effective modern C++.

And then have a local copy of cppreference.com (they provide a zip you can download) and set yourself some projects.

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

#8

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)

One motivation to learn C÷÷ could be to find a job. Rust looks interesting but C++ is still vastly more popular.

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

#9

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)

Mostly because of adoption. Rust is great, but I'm not really into it (subjectively).

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

#10

Piggybacking of this post, if anyone has any similar resources for best practices in modern C I'd be interested. There don't seem to be any moocs that go beyond introductory material and K&R obviously doesn't cover modern tools and methods.

“C Interfaces and Implementations” by David R. Hanson is what I used when I had a similar concern a few years ago. It’s from 1997, so no, it doesn’t cover the newest C standards, which I understand is your main concern. Though C11 didn’t add too much semantically, for what it’s worth. That said, the book provides great design patterns for writing C in an object-oriented sort of manner, more idiomatic to OOP.

Peter Hintjens was writing “Scalable C” a couple years ago, but recently died, and never got very far unfortunately.

Post reply on HN