Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would like to contribute, but modern C++ looks positively alien to me. I am an experienced developer and know C like the back of my hand, any pointer on how to learn to write 2010's C++ without going through the absolute basic tutorials?


The other link posted here is great info but might be a bit overwhelming. Some of the highlights of modern C++ to look into:

Lambda functions

Smart pointers = less need for *

Move semantics = less need for pointers, efficient pass/return-by-value

Type inference with `auto`

`nullptr` = strongly-typed null pointer type sans macros

`constexpr` = compile-time programming sans macros

Deleted functions = can prevent things like accidental copies

Range-based `for` = very similar to Java's for-each

That should mostly catch you up from C++03 to C++11-ish (language features only; there's plenty more to explore with library changes). C++14 and 17 had some refinements to those items so review the above in a current context for additional enhancements to them. C++20 adds some major things like concepts and modules, but starting there might not be the best idea to get up to speed.

(I'm a C++ amateur and hobbyist, so I might not be using 100% correct terms above! I'm also a very, very minor SerenityOS contributor.)


Stroustrup basically wrote a book for people like you, called A Tour Of C++, directed at experienced C/'old school' C++ programmers who want to learn modern C++. It's pretty short too (only like 200 pages) - can easily be read in a weekend.


I was in a similar situation to yours when work required me to become a C++17 expert practically overnight.

Bjarne (inventor of the language) has a "blue book" that is very good and pretty comprehensive (if a bit dry and academic). I read it cover to cover in a couple days - not really retaining everything but learning what I didn't know. Then I read Scott Meyers's Effective Modern C++ to get up to date on the latest thinking and really nail down some of the finer points.

YMMV but this worked well for me to get a good feel for C++ the language. Mastering the STL and/or Boost is a journeyman job, though, as is mastering (any) build system. Of course there is no substitute for firing up the editor and writing real code.


C++ is the one language that actually scares me. I’ve seen several people say things along the lines of “I’ve been learning C++ for 10 years” and I have trouble finding introductions to the language that actually teaches all the features added over the years , and not just as “C with classes”.


C++ is undoubtedly a complex language, however I think most disregard how complex others also are.

For example, when checking the feature list of latest versions from Python, Java, C#, F#, Typescript as a couple of examples.


I suppose I agree, I lost track of Python and C# recently myself.



I haven't worked with c or c++ in a long time but I found the repo so beautifully usable it's great




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: