Hacker News new | ask | show | jobs
Ask HN: How would you recommend learning C++ in 2018?
11 points by flickzcode 2869 days ago
6 comments

Depends how you like to learn. If it's through a book, others online have recommended this book if you're a programmer already [0]. Then go and learn the latest things they're adding in C++. If you're new to programming and like books, you could try this [1].

If you learn better through videos, maybe try out TheNewBoston's stuff on Youtube [2].

Some extra links that might be helpful [3][4].

[0]: https://tinyurl.com/ydy3kq48

[1]: http://www.stroustrup.com/4th.html

[2]: https://tinyurl.com/p53p4kw

[3]: https://stackoverflow.com/questions/388242/the-definitive-c-...

[4]: https://www.quora.com/What-are-the-best-C++-books

Thank you
you're welcome!
First, you should know that C++11, the C++ standard ratified in 2011, redesigns the language to promote safer and more expressive code. C++11 introduces rvalue references, std::unique_ptr (a smart pointer with unique ownership semantics and a move constructor, superseding std::auto_ptr), auto (type inference), and container iteration syntactic sugar. C++14 and C++17 enhance the changes brought by C++11.

Know about RAII, ownership, move semantics, and smart pointers. Please know that some common C idioms are considered poor C++. (E.g. resource cleanup via goto is superseded by destructors, and malloc and free are superseded by new and delete, which in turn are discouraged in favor of smart pointer RAII.)

Modern C++ is a good programming language, but unfortunately, many resources don’t teach it. Make sure that the resource covers C++11 at earliest. Bjarne Stroustrup, the original implementor of C++, has written some good books. Herb Sutter is another notable C++ author. See also https://stackoverflow.com/q/388242/8887578.

There was a discussion recently: https://news.ycombinator.com/item?id=16535886

I personally started with the Tour of C++ and plan to go through this series: http://craftinginterpreters.com

Why do you want to learn it? If you are interested in games try https://handmadehero.org/
The Tour of C++ and a project or two
Not at all