Sign in to follow this  
Dumuzi

Need C++ book recommendation for experienced programmer

Recommended Posts

I'm looking for suggestions on a book that will help me bring my C++ skills up a few levels. I've been a C programmer for about 15 years. I've done a fair amount of work in C++ (and most recently in C#). I understand and use OO concepts but I'm far from being an expert. What I'm looking for is a book that will cover the more advanced aspects of C++ without glossing over the foundation too much. I don't want a recipe book or a 100 tips type of book. I also don't want a book then spends 300 pages teaching me how to write loops, use pointers, or create classes. Any suggestions? Thanks, Dumuzi

Share this post


Link to post
Share on other sites
I recommend The C++ Primer. Beware that there's another book by a similar title. I haven't read that one, though. I've only read the one by Stanley B. Lippman et al. It's a great reference. Despite the 'Primer' in the title, I would not recommend it for beginners to programming.

Share this post


Link to post
Share on other sites
You don't want tip books, but I recommend the Exceptional C++ series by Herb Sutter. It's written in a tip fashion, but many articles on a single section tend to blend together. It will go into many of the C++ pitfalls and what to do about them, which may be new to you coming from C (exception safety, multiple inheritance pitfalls, object lifetimes, etc.). As the former chair of the ISO committee, he also goes into many of the reasons why they choose to do things a certain way, which is always an interesting perspective to hear.

Share this post


Link to post
Share on other sites
There's:

Some of my favorites:

Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson, John, Vlissides
Large Scale C++ Software Design by John Lakos
C++ FAQ by Marshall Cline
Effective C++ by Scott Meyers
More Effective C++ by Scott Meyers
Effective STL by Scott Meyers

Cheers,

Bob

Share this post


Link to post
Share on other sites
I've ready some of the above, and they were all great. My favorite C++ book which hasn't been mentioned is:

The C++ Programming Language - Special Edition
by Bjarne Stroustrup

The definitive C++ reference, written by C++'s creator. It's not generally recommended to C++ beginners, but being an experienced programmer you might follow it better. When I finally read it, I wished I had done so earlier. Good for knowing all the tiny details of the language (while the books mentioned above are probably better for tips on practical use). I guess it depends what type of person you are (I like to know all the details, then get practical tips).

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
Quote:
Original post by Dumuzi
I don't want a recipe book or a 100 tips type of book.

I'm still recommending Effective C++ by Scott Meyers.


A very good book for someone with a good C background.

Josuttis' C++ Standard Library will also be a good intro to the standard library, and is an adequate reference.

Share this post


Link to post
Share on other sites
Quote:
Original post by BeauMN
I've ready some of the above, and they were all great. My favorite C++ book which hasn't been mentioned is:

The C++ Programming Language - Special Edition
by Bjarne Stroustrup

The definitive C++ reference, written by C++'s creator. It's not generally recommended to C++ beginners, but being an experienced programmer you might follow it better. When I finally read it, I wished I had done so earlier. Good for knowing all the tiny details of the language (while the books mentioned above are probably better for tips on practical use). I guess it depends what type of person you are (I like to know all the details, then get practical tips).

Yes if you are an experienced C programmer this would be the book for you since it's actually aimed at C programmers converting to C++. I tried to read it before I knew C and it annoyed me because the author would keep bringing up all the differences from C and how stuff is done in C++ vs C. After learning C it was alot easier to read and made alot more sense. Definitely the authorative source and every C++ programmer needs to own a copy sooner or later.
Only downside is that the book is information dense kinda like the original K&R C book in that you have to read it slowly and carefully to make sure you got everything that was being said.

[Edited by - daviangel on September 9, 2009 2:21:41 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Scourage
Effective C++ by Scott Meyers
More Effective C++ by Scott Meyers
Effective STL by Scott Meyers


These. I truly believe "experienced c++ programmers" as a whole have learned to use the language too well to notice some of the obvious flaws in their programming. I know I was culpable. Also:

Refactoring, by Martin Fowler et al.

That one's good too.

Share this post


Link to post
Share on other sites
Nobody mentioning "Modern C++ Design" by Andrei Alexandrescu? I found that one quite interesting and a nice change from all the "typical" C++ books. Away from the pitfalls of multiple virtual inheritance and right into template magic. Maybe not so recommended if you need to support oldish compilers.

-pretty much all about templates
-common patterns done with templates (factories, multiple dispatch)
-policy based design (plug together bits of "behaviour" for flexible classes)
-type lists and some ways to use them

One danger might be feeling the need to start using templates for everything that you just might need again.

Stuff done after reading:
-using type selectors and compile time inheritance checking for a shared pointer that automatically uses internal ref counting if the pointee is derived from refCountable and external ref counter otherwise (requiring the user to know about that detail and manually making the decision felt slightly wrong)

-using type lists and selectors for platform independent "automatic" typedefs, that always select a signed/unsigned/float type of the requested size, like:

typedef TypeBySize<2, UnsignedType> uint16;

-other minor stuff

Share this post


Link to post
Share on other sites
Quote:
Original post by Trienco
Nobody mentioning "Modern C++ Design" by Andrei Alexandrescu?

I think the book is a little bit too advanced for the OP.

Quote:
Original post by Trienco
-using type selectors and compile time inheritance checking for a shared pointer that automatically uses internal ref counting if the pointee is derived from refCountable and external ref counter otherwise

Is intrusive reference counting really that useful? If you are worried about performance, make_shared only does one dynamic allocation for the object and the refcount at once.

Share this post


Link to post
Share on other sites
Quote:
Original post by phresnel
If you want to master C++ template magic, then get a copy of Vandevoorde/Josuttis: "C++ Templates: The complete guide".


Seconded. It was after reading this book that "Modern C++ Design" suddenly started to make sense (at which point I deeply regretted having sold "Modern C++ Design" already).

Share this post


Link to post
Share on other sites
Quote:
Original post by Konfusius
Quote:
Original post by phresnel
If you want to master C++ template magic, then get a copy of Vandevoorde/Josuttis: "C++ Templates: The complete guide".


Seconded. It was after reading this book that "Modern C++ Design" suddenly started to make sense (at which point I deeply regretted having sold "Modern C++ Design" already).


Yes, it's not only great for templates, but also has (imho) unbeatable explanations (apart from the holy standard itself) about lookup rules and overload resolutions.

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
Is intrusive reference counting really that useful?


Probably depends on how forced it is, but I have certain constructs that are simply meant to be used like that. Not much extra work and it just feels like a cleaner solution (I also can't dare to introduce Boost without risking some people getting a heart attack... using std::map was already a shock to some).

I did however just order the other suggested book about templates. Reviews look promising and you can never know enough details (helps to understand just what those weird compiler errors are trying to tell you).

Share this post


Link to post
Share on other sites
Lots of input. Thanks for all of the replies. I'm going to start with C++ Primer and the Stroustrup book and then move on to the Effective C++ series. I'll see where I need to go after that.


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