Ask HN: Best way to learn modern C++?
686 pointsDo 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.
Comments (173) 47 threads
Earlier commentsFor 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! :-)
Not being a smart@$$ here. Any language you want to learn will only become natural when you've used it for a significant project or set of exercises. Either clone or port something non trivial, or use it for your latest pet project, or get permission to use it at work.
Also, the answer to this question depends a lot on your previous experience with other languages. If you're well-versed in another C-like language, jumping right in and starting to make something will probably teach you a lot, really quickly. If you're more of a beginner in programming generally, you need a book or a teacher.
I sometimes get carried away and stop reading more after I cross some threshold which prevented me from noticing lot of nice things like best practices that were happening in the industry/or better design patterns etc..
Not learning from books/teaching can make it hard to improve. I love reading other peoples code and thought processes because it often reveals how I'm missing something in my toolbox.
Studies have shown that one of the best ways to remember is to take a stab at a problem before learning the solution. So even quizzes on using libraries has helped me learn methods and concepts I would have not learned on my own if left to my own way of coding. I try a simple problem on my own before learning that there is a cleaner, more efficient solution. It's easier and more approachable to do that with small problems than trying to revise an entire document of code.
Lastly, I think a lot of experts underestimate the gap between novice and intermediate, where it's really hard and frustrating to attempt things that are a bit more complicated, requiring more background knowledge than just whats shown on the surface.
It's similar to why university lectures work best if the audience has already done its assigned reading. The people in the audience have better questions in mind while listening, so they can better intuit when a gap is filled in or if some part of the explanation doesn't make sense.
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.
They are not free and prevent certain kinds of optimization as well as allow accidentally sharing state.
Of course it's a very good book though.
My recommendation is for "Accelerated C++" by Koenig and Moo. It's rooted in actual teaching experience and compared to most C++ books is pretty slim.
The only negatives these days is that it is a bit old and (still) expensive.
All comments shown.
Couldn't load more comments. Check your connection and try again.