Ask HN: How would you recommend learning C++ in 2018?

11 points by flickzcode ↗ HN

8 comments

[ 2.9 ms ] story [ 30.4 ms ] thread
The Tour of C++ and a project or two
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

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.