Live data from Hacker News

Ask HN: How to refresh on modern features of C++?

news.ycombinator.com

1–10 of 63 posts

Ask HN: How to refresh on modern features of C++?

#1
I first learned C++ 14 years ago and have only used it in a non-trivial fashion on one or two short projects since then.

Today, reading an article on popular C++ myths [1], I now realized there are a TON of things I didn't realize modern C++ can do now. auto, unique_ptr, for_each, and range-for loops were new to me. I'm not 100% certain if all of these were recent additions to the language.

What are some things I can do to brush up on the modern features of C++?

[1] https://isocpp.org/blog/2014/12/myths-1

Re: Ask HN: How to refresh on modern features of C++?

#4
Herb Sutter, one of the most prolific C++ experts out there, recently gave a talk on Modern C++ [1]. In the beginning of his talk, he states that every C++ developer should read a "Tour of C++" [2] by Bjarne Stroustrup, the original designer of C++.

I recently read it and it's great. The book has less than 200p, but still covers the most important parts of C++11, albeit not in great detail (the reader is pointed to "The C++ Programming Language" by the same author for that). Read it! And watch the youtube video in [1].

[1] https://www.youtube.com/watch?v=xnqTKD8uD64 [2] http://www.amazon.com/Tour-In-Depth-Series-Bjarne-Stroustrup...

Re: Ask HN: How to refresh on modern features of C++?

#5
post #2

I've not read it, but the author's other books have been well-regarded for years: http://www.amazon.com/Effective-Modern-Specific-Ways-Improve...

I've read it already, the final retail version, not the early draft and its pretty awesome (like all his other books).

IMO its better than the Bjarne Stroustrup book (which i've read too), but any of the two is fine to learn modern C++ features.

Re: Ask HN: How to refresh on modern features of C++?

#6
post #4

Herb Sutter, one of the most prolific C++ experts out there, recently gave a talk on Modern C++ [1]. In the beginning of his talk, he states that every C++ developer should read a "Tour of C++" [2] by Bjarne Stroustrup, the original designer of C++. I recently read it and it's great. The book has less than 200p, but still covers the most important parts of C++11, albeit not in great detail (the reader is pointed to "…

cppreference.com is a good resource too. It's updated frequently.

http://en.cppreference.com/w/

Re: Ask HN: How to refresh on modern features of C++?

#7
Similar story here, I played with C++ back in 1998 and then again in 2007.

After reading these two books it definitely changed the way I see and work with C++, I fell in love with it.

So reading old code-bases is very common, you still need to understand the old C++ anyway:

Professional C++, Wrox, Jan 2005

Then to get yourself up to speed with C++11 and C++14:

Professional C++ 3rd Edition - Wrox, Sept 2014

Re: Ask HN: How to refresh on modern features of C++?

#9
Just read the new edition of C++ Programming language by Bjarne Stroustrup ;)

Some things are hard to come by in any shorter sources. And at times you have to dig into the standard.

An example of rather obscure thing in C++ which changed in C++11 (sequencing): http://en.cppreference.com/w/cpp/language/eval_order

And another thing which can be pretty confusing without carefully reading the standard. Copy elision vs move constructors...

See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n324... § 12.8 (Copying and moving class objects), #32 - 33

Re: Ask HN: How to refresh on modern features of C++?

#10
post #2

I've not read it, but the author's other books have been well-regarded for years: http://www.amazon.com/Effective-Modern-Specific-Ways-Improve...

I have read it. Would highly recommend it. Most other guides just go over the neat things, but this one also goes over all the potential pitfalls and things to watch out for (and it's C++ -- there's always something to watch out for :))
Post reply on HN