views:

186

answers:

5

I'm a C# programmer that is looking to branch out. I'm bored of writing business software and want to start getting into graphics programming and games/simulators. So I figured, although writing that stuff isn't impossible in managed code, the "right" way to do that would be to look to C++, of course focussing on the language first, then getting into OpenGL or DirectX (or whatever).

Way way back ('98? '99?) I had tried and failed to really grasp Stroustrup's The C++ Programming Language. I know that this book is often not recommended for the beginner. Anyway, I picked it back up (in a much more recent printing) and I'm actually getting it and enjoying it. I also have a copy of his textbook, Programming: Principles and Practice Using C++, which, as I understand it, is really geared toward teaching programming, not necessarily C++. I'm certainly not arrogant enough to claim I don't have anything more to learn about programming, data structures, algoriths, etc., however I'm not a novice there either.

So my question is, with the goal of gaining the broader and more real-world-useful understanding of C++ and given my background, on which should I focus? The denser (as I perceive it) TCPPPL or the gentler Programming?

EDIT: I thank everyone for the responses. However, I've got a personal choice here to make between these two books. Granted there are other very good books out there, but I'm already a good length into both of the books I mention and I'd like to finish one. So, can anyone respond on which would be the better and why? Time is not an issue; I'm not looking (at this point) at an "accelerated" read.

+4  A: 

Well if your goal is to get into graphics then it might be better to pick up a book on OpenGL that uses C++ for examples. Work your way through the graphics book and use the C++ books for reference when you come up against a C++ construct that you don't understand. I think this would be a much funner way to learn. Plus you'd be killing two birds with one stone.

Peter
OpenGL is a C API, so I imagine the best books for it use C rather than C++. Good point in general, though.
Steve314
+1  A: 

Maybe you could take a look at other authors too? I used C++ Primer and I was quite satisfied.

gruszczy
I have an earlier edition of this from probably 9 years ago. Something about it rubbed me the wrong way.
Chris Simmons
So do I. I don't like some of the practices used there (like variable names), but anyway it proved quite useful, when I didn't have internet connection but wanted to code something anyway.
gruszczy
+1  A: 

This has come up a few times before. However, to get you started I'd highly recommend Accelerated C++ - then more on to Scott Meyers' Effective C++ series.

Stroustrup's books are good for reference or background reading.

Phil Nash
+4  A: 

For all programmers just getting in to or returning to C++ from a long absence, I always recommend Accelerated C++. It's short, not too dense, and actually focuses on using C++ in a real-world way. Instead of implementing a linked list, for example, it shows you how to use std::list<>. Usually a programmer who implements their own linked list to use in real code should be shot. This book is refreshing.

Once you have grokked C++ on a novice to intermediate level, it's time to start getting in to nitty gritty details. My recommendations for this are TCPPPL, the Standard itself, Meyer's Effective C++ series (though dated and I don't agree with everything) and other more advanced works such as Modern C++.

If you read and understand all those, you will know more about C++ than 90% of the C++ population.

Good luck.

John Dibling
Funny, I had Accelerated C++ I think shortly after it came out (author is Moo or Moos, right?). I remember it being quite good.And I lost it. Only book I think I ever just ... lost.
Chris Simmons
@Chris: Some new C++ programmer probably stole it. :)
John Dibling
@Ghris Koenig and Moo, actually. Husband and wife, and members of the original C++ dev team. It's probably the best book to learn C++ for someone that already understands programming concepts.
anon
+1 for `Meyers` excellent serie. It covers a lot of gotchas.
Matthieu M.
+1  A: 

I can certainly vouch for Stroustrup's book. While dense, it is the canonical text, and it is readable. In addition, the problems he gives are illustrative, educational, and fun. For example, I learned about Duff's Device working through his book. However, I am not familiar with Programming: Principles and Practice Using C++

gnavi