PDA

View Full Version : Suggestions for learning C++?


steve
12-23-2010, 06:44 PM
I'm taking CS as my major in college. I took Data Structures last semester and ended up dropping the class because I felt lost.

I'm taking it again in the Spring. If anyone else can suggest some decent books that helped them learn, or a website, it would be greatly appreciated.

My professor just free styles everything up on the board and doesn't guarantee any of his code. For the final, he had people write 100+ lines of code from scratch, with no notes! Apparently, some of the PhD entrance exam questions were easier than questions on his final (and this is only a junior level course for a BS degree).

Anyway, any suggestions would be greatly appreciated!

Tabasco
12-23-2010, 07:53 PM
For data structures, try building simple database apps in php or another high-level web-enabled language. Maybe a simple accounting or budget system, or for something less boring try writing a simple game. Ultimately nothing teaches like experience and necessity.

For the game angle I would start with something high-level like this:
http://www.love2d.org

The lessons you learn by just creating something and solving your own problems, for better or worse, will carry over to any language.

For more specific help, try getting on the mailing list here:
http://www.gameprogrammer.com/


Show me your code and conceal your data structures, and I shall continue to be mystified. Show me your data structures, and I won't usually need your code; it'll be obvious.
- Eric Raymond, The Cathedral and the Bazaar

revloc02c
12-23-2010, 10:28 PM
Here's a website for learning C++ if you are interested, but it is geared toward beginners. I am not a beginner in programming, but I am with C++ and I have found many things helpful that I have even used in other languages.

http://www.learncpp.com/ (http://www.learncpp.com)
(hmm, down atm, but I was using it just earlier today)

I have to agree whole-heartedly with Tobasco:
Ultimately nothing teaches like experience and necessity.
It's hard to just fabricate necessity, but working on EQEmu C++ code would be a good start. Just start trying to change stuff (obviously you'd have to have a server).

I know it can be hard learning extra stuff while you are taking college classes. So good luck to ya.

provocating
01-02-2011, 10:51 AM
I am no pro but I have heard good things about this book in the past.

http://www.amazon.com/Primer-3rd-Stanley-B-Lippman/dp/0201824701

visionkid
06-07-2011, 12:05 AM
http://www.amazon.com/exec/obidos/ASIN/0672326973/ref=nosim/cboard-20 better reviews / answers

visionkid
06-07-2011, 01:05 AM
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
http://www.amazon.com/exec/obidos/ASIN/0672324539/ref=nosim/cboard-20 no specific java terminology. Will compile fine.

provocating
06-07-2011, 08:19 AM
Well no matter if you are learning VB, C#, Java or C++ I think everyone should start by reading this book.

http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X

I cannot say enough good things about this book. It is not a technical book so much as a "good practices" book. It will also give you plenty of motivation and insight.

strider51
07-06-2011, 06:23 AM
Well no matter if you are learning VB, C#, Java or C++ I think everyone should start by reading this book.

http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X

I cannot say enough good things about this book. It is not a technical book so much as a "good practices" book. It will also give you plenty of motivation and insight.

Probably the most important book a programmer could read. I ask candidates if they've read the book, and if I get a yes with some interesting insights, it's almost a no brainier.

Also once you start looking into more code: Martin Fowler: Refactoring
http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672/ref=sr_1_1?ie=UTF8&s=books&qid=1309947447&sr=1-1

The refactoring book is also a must have for any programmer.


As far as learning c++, I agree with some of the previous posts. Start out making some data structures, like a linked list class. Then make a driver or program that uses your linked list. This is basically CS 101, but its a great way to start out and create something. Learning about pointers will help.

I'm not a huge codeProject fan, but here is the first linked list site I found.
http://www.codeproject.com/KB/cpp/linked_list.aspx

There is tons of help on stackoverflow too: http://stackoverflow.com/

lerxst2112
10-18-2012, 04:14 AM
Some C++ books I recommend. It's a bit of a necro, but since someone linked to here I figured better to keep all of the book recommendation in one place.

As mentioned by a few above, I also recommend The Pragmatic Programmer. Good common sense ideas to take to heart.

Thinking in C++ is a fairly decent book, and it's free to download. The first C++ book I read many years ago.
http://mindview.net/Books/TICPP/ThinkingInCPP2e.html

The Effective C++/STL books are very good. They aren't really "teach you C++" books, but more of a "Now that you think you know C++, here are some really good tips about how not to shoot yourself in the foot quite so often"
http://www.aristeia.com/books.html

C++ Gotchas is another book about how to do things the right way and why. If I had to pick one book I'd stick with Effective C++, but this is good after you've read that.
http://www.semantics.org/cpp_gotchas/index.html

Guru of the Week is also good reading. He wrote a couple books on it as well called Exceptional C++. I think the guru stuff covers most/all of that.
http://herbsutter.com/gotw/

C++ Coding Standards is another best practices type of book.
http://www.gotw.ca/publications/c++cs.htm

Writing Solid Code is an old book, and you'll probably only find it used or maybe at a library, but I think it is very good at describing how to write code with less bugs. I use the techniques described in the book every time I write code, and I am confident I write better code because of it. It's a lot of common sense (to me at least) stuff, but many programmers I know ignore these simple things and have tons of bugs because of it.
http://www.amazon.com/Writing-Solid-Microsoft-Programming-Series/dp/1556155514

Code Complete also has some really good best practices type information. I haven't read the second edition but I know others that have and they said it was still good.
http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670