Sign in to follow this  
ATC

Good C++11 resources for advanced programmer

Recommended Posts

ATC    551
Hey guys,

I'm wanting some learning resources for C++11 oriented toward advanced programmers. I already know C and C++ quite fluently. But since I haven't used either in a couple years for any serious/commercial work, I'm a bit rusty in certain areas. Some of the things I need to brush up on:[list]
[*]"const correctness"
[*]the various cast operators and when and when not to use each
[*]all of the stuff available in the 11 standard libraries and how to use them (I'm prone to reinvent wheels)
[*]proper C++ software design practices and conventions
[*]general best practices and pitfalls
[*]proper template class design
[/list]
In the past when I normally used C and C++ it was for actual systems programming, where often no implementation of the full standard libs and runtimes even existed (often had to roll my own malloc and free implementations). So while I know the syntax through-and-through, have intimate knowledge of pointers and memory and know how the language works/runs, I'm prone to "reinvent the wheel" in many situations because I didn't know the stdlibs already implemented the thing I needed. I also need to brush up on "const correctness", referencing, etc. And anything to help me better design classes, polymorphic interfaces, templates, operators, and software in general would also be very helpful. And I don't want to waste my time with beginners' books talking about variables being storage space for numbers. [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]

I'm not really doing this for any important project or commercial work... we're using C# for our projects. But I invested a lot of time (and money) in the past into my programming skills, which included C and C++. It's not an art I want to lose. And since I now have Visual Studio 2012 and C++11 is out and taking the programming world by storm I don't want to end up behind the times; I've got to keep up with the rest of the world.

I'm looking for any online references/materials, articles, tutorials, books, videos and anything and everything that can be helpful to me in re-mastering C++ and learning about the new C++11 standard.

Thanks,

--ATC--

Share this post


Link to post
Share on other sites
AlexB.hpp    201
First of all look at this [url="http://gcc.gnu.org/projects/cxx0x.html"]link[/url], then you can read all interesting you proposals by clicking it.

What about books... It will be written sometime but probably after > 0.5 year. IMHO.

Read some cool guy's blogs. Just like [url="http://www.drdobbs.com/cpp/c11-uniqueptr/240002708"]that[/url] one is Edited by AlexB.hpp

Share this post


Link to post
Share on other sites
Matt-D    1574
Sorted roughly in tutorial-to-reference order:

[url="http://www.pearsoned.co.uk/bookshop/detail.asp?item=100000000389209"]http://www.pearsoned...100000000389209[/url]
[url="http://www.artima.com/shop/overview_of_the_new_cpp"]http://www.artima.co..._of_the_new_cpp[/url]
[url="http://www.cppstdlib.com/"]http://www.cppstdlib.com/[/url]

// BTW, it's "class template", not "[s]template class[/s]". As in, there are two kinds of templates ("families") -- [url="http://en.cppreference.com/w/cpp/language/class_template"]class templates[/url] and [url="http://en.cppreference.com/w/cpp/language/function_template"]function templates[/url]. A simple way to remember this is to just substitute "family" for "template" (which it is) and read this like an ordinary English phrase -- "class family" (as in: family of classes) sounds just right, "[s]family class[/s]" doesn't really make much sense (class of families? [img]http://public.gamedev.net//public/style_emoticons/default/wacko.png[/img] ). Edited by Matt-D

Share this post


Link to post
Share on other sites
Bregma    9202
I'd strongly recommend, for your level of knowledge and what you're asking, "The C++ Programming Language" by Bjarne Stroustrup. It does not (yet) address C++11 features, but most of what you listed is not C++ but just the basic language as it's been since about 1992. There is no better reference for the fundamental language, and he writes clearly and concisely and covers almost everything you mentioned, including the reasoning behind language features and idioms.

Share this post


Link to post
Share on other sites
MikeBMcL    173
Over the summer I wrote a free (reg-ware) eBook for SyncFusion targeted at C# developers aiming to learn modern C++. You might find it helpful as it covers const-correctness, the cast operators and their use cases, references, the ins and outs of all the constructors and assignment operators, namespaces (something I think is important in modern C++ but which is easy for people coming back to it to overlook or ignore), RAII and the Standard Library's smart pointers (unique_ptr, shared_ptr, the make_shared function) and (for Windows) ComPtr, strings (much better than they used to be but they could be better still), lambdas, some basic idioms, and some of the other important features of the C++ Standard Library (std::vector and other containers, iterators in general, and some miscellany suggestions for things to look into further).

It's not as strong on the Standard Library as it could be, but the design goal was approximately 100 pages with a focus on practical examples (there are ~20 sample programs with full code). Link here: [url="http://www.syncfusion.com/resources/techportal/ebooks/cplusplus"]http://www.syncfusion.com/resources/techportal/ebooks/cplusplus[/url] ; intro/overview here: [url="http://channel9.msdn.com/coding4fun/blog/C-for-C-Developers-with-C-Succinctly"]http://channel9.msdn.com/coding4fun/blog/C-for-C-Developers-with-C-Succinctly[/url] . Comes in PDF and MOBI and the code samples are available on bitbucket: [url="https://bitbucket.org/syncfusion/cpp_succinctly"]https://bitbucket.org/syncfusion/cpp_succinctly[/url] .

(I've already been paid for it and don't get any bonuses for downloads or anything so I'm recommending it purely on a "you may find it useful" basis, without any ulterior motives. If you download it and it helps you, great! If you skip it, that's fine too.)

Ultimately when the next edition of The C++ Programming Language comes out in March, that'll definitely be the book to get.

Share this post


Link to post
Share on other sites
kloffy    1318
As mentioned by mrbastard and MikeBMcL, channel9 is pretty great.

Since you asked about C++11: This is the best explanation of rvalue references that I have heard so far:

[url="http://channel9.msdn.com/Shows/Going+Deep/Cpp-and-Beyond-2012-Scott-Meyers-Universal-References-in-Cpp11"]http://channel9.msdn...rences-in-Cpp11[/url] Edited by kloffy

Share this post


Link to post
Share on other sites
ATC    551
Thank you everyone! Lots of great materials! Keep it coming if anyone has more! :)

[b]@ MikeBMcL:[/b]

I downloaded the book in PDF; sounds great! And I don't think the desire to make money would be an "ulterior motive". If it were then we'd all be a bunch of evil, shady bastards because we all have to eat. ;-)

Share this post


Link to post
Share on other sites
gekko    478
If you want to learn about the 6 features Microsoft added in VS2010, the blog series STL wrote covers the topics in a lot of depth. I highly recommend you start there, because it doesn't skip over a lot of the details. It is a bit dated, but the stuff that is difference is pretty minimal, so it's still a good place to start.

[url="http://blogs.msdn.com/b/vcblog/archive/2008/10/28/lambdas-auto-and-static-assert-c-0x-features-in-vc10-part-1.aspx"]http://blogs.msdn.co...c10-part-1.aspx[/url]
[url="http://blogs.msdn.com/b/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part-2.aspx"]http://blogs.msdn.co...c10-part-2.aspx[/url]
[url="http://blogs.msdn.com/b/vcblog/archive/2009/04/22/decltype-c-0x-features-in-vc10-part-3.aspx"]http://blogs.msdn.co...c10-part-3.aspx[/url]
[url="http://blogs.msdn.com/b/xiangfan/archive/2010/05/10/c-0x-features-in-vc2010-nullptr.aspx"]http://blogs.msdn.co...10-nullptr.aspx[/url]

Actually, the nullptr one wasn't by STL, but he did a video here: [url="http://channel9.msdn.com/shows/Going+Deep/Stephan-T-Lavavej-Everything-you-ever-wanted-to-know-about-nullptr/"]http://channel9.msdn...-about-nullptr/[/url] .

After that, I also recommend Scott Meyer's PDF, Herb Sutter's Lambdas Lambdas Everywhere presentation, and the latest from Going Native 2012. There was one on the library changes, and Alexandrescu's variadic template presentation is quite good.

http://channel9.msdn.com/Events/PDC/PDC10/FT13
http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Variadic-Templates-are-Funadic
http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/STL11-Magic-Secrets Edited by gekko

Share this post


Link to post
Share on other sites
lride    674
Not sure if this got mentioned, but The C++ Standard Library: A tutorial and reference (2012)
[url="http://www.amazon.com/The-Standard-Library-Tutorial-Reference/dp/0321623215/ref=sr_1_1?ie=UTF8&qid=1350705259&sr=8-1&keywords=c%2B%2B+standard+library"]http://www.amazon.co...tandard library[/url]
this is an awesome book. PDF version's out there if you don't want to spend some money on this. Edited by lride

Share this post


Link to post
Share on other sites
Saruman    4339
[quote name='lride' timestamp='1350705339' post='4992037']
this is an awesome book. PDF version's out there if you don't want to spend some money on this.
[/quote]
There is no free version unless you download it illegally which is stealing.

Share this post


Link to post
Share on other sites
ATC    551
[quote name='Saruman' timestamp='1350708478' post='4992046']
There is no free version unless you download it illegally which is stealing.
[/quote]

Tell me... "friend"... When did [i]Saruman the Wise[/i] abandon reason for [i]madness[/i]?!

[media]http://www.youtube.com/watch?v=7gqvFgo-sS0[/media]

Lol, sorry, couldn't resist! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] But true dat... true dat...

I have bee considering buying that book though because it looks great, like something I could really use. Edited by ATC

Share this post


Link to post
Share on other sites
EddieV223    1839
Not free but probably the best c++11 reference available.

[url="http://www.amazon.com/The-Standard-Library-Tutorial-Reference/dp/0321623215/ref=sr_1_1?ie=UTF8&qid=1350762686&sr=8-1&keywords=c++11"]http://www.amazon.co...&keywords=c 11[/url]

The first couple chapters are just showing you the big new features. The rest of the book continues showing how to use c++11 including the smaller new features. This is what you want I think.


And yes VS2012 is really good IDE for c++, far better than vs2010. However there are some other free IDE's that are just as good like, QTCreator and Eclipse, QTCreator being the easiest to setup, learn, and get running. Eclipse being the opposite harder to setup and learn but more features than QTCreator or VS2012, ( has a side effect of being hard to learn ) .

So I would suggest VS2012 for windows only projects and QTCreator for cross platform. Both support c++11 compilers (microsoft's and GNU). But neither compiler is completely c++11 standard compliant. It will will be some time until compiler support catches up. However both compilers support the "Big" new features such as memory classes, for each loop, nullptr, ect.... Edited by EddieV223

Share this post


Link to post
Share on other sites
iMalc    2466
There's a lot of really good info here:

[url="http://en.wikipedia.org/wiki/C%2B%2B11"]http://en.wikipedia.org/wiki/C%2B%2B11[/url]

Lots of concise introductions and useful examples.

Share this post


Link to post
Share on other sites
mrbastard    1577
From Scott Meyer's blog: the publisher of his Effective series, several Stroustrup books, and the Josuttis books has a [url="http://www.informit.com/promotions/promotion.aspx?promo=138989&meyers"]30-40% sale[/url] on c++ titles until 30th october.

Probably a good time to invest... [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] Edited by mrbastard

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this