Live data from Hacker News

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

news.ycombinator.com

21–30 of 63 posts

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

#21
Well at the risk of stating the obvious, there's a lot of armchair programmer style "read this", "watch this" instruction here. It's much better to do something concrete.

Go and do a trivial project in it, cppreference.com and cplusplus.com have c++11 tags on the new features. I'm sure you've had ideas recently and I'm sure the project is less trivial than you thought!

I think looking at language features first is "a solution looking for a problem" attitude.

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

#22
post #6

Earlier quoted context omitted.

cppreference.com is a good resource too. It's updated frequently. http://en.cppreference.com/w/

I can't stand that site. I try to use the old SGI stl reference whenever I can.

it's a great site, but it's jarring at first. the sgi stl reference doesn't have a lot of c++11 in it.

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

#23
As other said, Meyer's book is highly recommended.

Also, this talk would give you a very general overview of the new features of the language:

http://channel9.msdn.com/Events/GoingNative/2013/Opening-Key...

Another book that can be a refresh introduction would be:

http://www.amazon.com/Tour-C--Depth/dp/0321958314/ref=sr_1_1...

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

#25
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 :))

I would like to read this book but the O'Reilly website eBook + Print combo deal is not available until next year.. Does anyone know how I can order both and get the early access ebook now and then the print book when it's ready?

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

#26
You may like to read and search the questions on stackoverflow. They have a lot of C++11 and C++14 questions and code examples and many of the contributors are very experienced with C++.

   http://stackoverflow.com/tags/c%2b%2b11/info
   http://stackoverflow.com/tags/c%2b%2b14/info
I use C++ almost daily. I love it. I've used it for many years now. Having said that, I try to avoid the newer standards unless I absolutely must use them.

Don't get me wrong. The new features are great. I love nullptr, fixed width integers, to_string, stol, etc. but I sometimes work in environments with very old compilers that don't offer these features. And when the only code you have is written for C++11 or newer, it can take a great deal of time and effort to make your code work on the older systems.

Also, if what you need is in the standard, then don't use any external libraries. There are a lot of great libraries out there (Boost, Crypto++, etc.), but they add complexity and build dependencies and can cause all sorts of support issues. If you add Boost only because you need to parse arguments, then you're really causing yourself and developers who come after you more trouble than it's worth. So every time you think you need an external library, think twice and talk it over with other, more experienced developers.

When I need more features than the older standard provides, I'll use a newer standard, but I strive to only use the exact features I need (don't go wild and convert your entire code to C++11). And as a very last resort, I'll use an external library (but only a mature, widely used one) when I cannot easily write what I need with std C++.

Hope this helps. And whatever you decide, I'm sure you'll enjoy working with C++.

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

#27

Well at the risk of stating the obvious, there's a lot of armchair programmer style "read this", "watch this" instruction here. It's much better to do something concrete. Go and do a trivial project in it, cppreference.com and cplusplus.com have c++11 tags on the new features. I'm sure you've had ideas recently and I'm sure the project is less trivial than you thought! I think looking at language features first is "a…

People who learn C++ this way tend to miss stuff out, I think - there are a lot of thing that you can just muddle your way though without really understanding.

I'm sure there are some people that think this will be OK; after all, lots of people say you don't really have to understand templates unless you're writing a library (and so on). But I don't think it will be OK. There was very little in C++98 (that I knew well, at the time) that it was OK not to know; unless you knew all of it, pretty much, you couldn't really use any of it safely. (This is how Scott Meyers makes his living.) I can't imagine C++11 will be any different; I might not know it well, but I do note that it has many of the same people behind it.

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

#28
post #26

You may like to read and search the questions on stackoverflow. They have a lot of C++11 and C++14 questions and code examples and many of the contributors are very experienced with C++. http://stackoverflow.com/tags/c%2b%2b11/info http://stackoverflow.com/tags/c%2b%2b14/info I use C++ almost daily. I love it. I've used it for many years now. Having said that, I try to avoid the newer standards unless I absolutely mu…

I too worked with C++ for years but I haven't for some time. I plan to learn the C++11 stuff and get back up to speed because I hate the feeling of falling behind in a language that really has no competition in the niche it fills.

Here is a somewhat off-topic question for you: what is the job market like for C++? Is it mostly maintaining/enhancing legacy code or is there considerable new code being written in C++?

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

#29
post #27

Well at the risk of stating the obvious, there's a lot of armchair programmer style "read this", "watch this" instruction here. It's much better to do something concrete. Go and do a trivial project in it, cppreference.com and cplusplus.com have c++11 tags on the new features. I'm sure you've had ideas recently and I'm sure the project is less trivial than you thought! I think looking at language features first is "a…

People who learn C++ this way tend to miss stuff out, I think - there are a lot of thing that you can just muddle your way though without really understanding. I'm sure there are some people that think this will be OK; after all, lots of people say you don't really have to understand templates unless you're writing a library (and so on). But I don't think it will be OK. There was very little in C++98 (that I knew wel…

obviously we disagree! i think it's ok to miss out on language features.

templates, as you say yourself you're ok not to know. you're also not ok not to know exceptions.

there's other stuff too, you can get away without the C preprocessor. C++ is too big to know all of and it's a waste of time to invest time trying to, unless you are on a standards committee or are writing a compiler...(and even then you can get away with being a specialist!).

it's much better to be a program writer than a language lawyer and dare I say it: more satisfying too.

i draw a huge distinction between people that understand a language and people that can use a language, and i think people underestimate the time and effort in understanding a language. i think that time and effort could be better spent writing programs.

Post reply on HN