|
06-11-2010, 08:26 PM | #1 | |
Blue Psychic, Programmer
Join Date: Feb 2007
Location: Home!
Posts: 8,814
|
I'm finally learning C++! Tips?
*throws confetti and pumps the jams*
Been waiting to pick up C++ since I took my first programming course three years ago! So in celebration, I'm asking for any tips people might have, good resources, books, compilers, etc. I think I still have Borland's Turbo C++ installed, and I know I have Visual C++ with my Visual Studio installation, but I'm not sure how up-to-date the former is or if the latter only compiles to the CLR.
__________________
Quote:
Journal | Twitter | FF Wiki (Talk) | Projects | Site |
|
06-11-2010, 08:30 PM | #2 | |
adorable
Join Date: Sep 2007
Posts: 12,950
|
Sorry. Couldn't help it.
Quote:
__________________
this post is about how to successfully H the Kimmy
|
|
06-11-2010, 09:12 PM | #3 |
A Threat to the District
|
I don't actually know C++, but I do know the warnings that are bandied about everywhere. It is a huge language. To paraphrase this guy Bjarne Stroustrup bolted everything he had ever heard of onto C to create it. Pick a subset of it and learn to use that well, and should you ever start trying to do anything complicated with templates... God help you.
Aside from that, really get to know how pointers work. This alone will save you a lot of time when you start wanting to do things you're used to in regular OO languages, like over-ride a method form a superclass. From what I understand, this involves virtual-tables of function pointers. Also important is memory management. C++ doesn't have a garbage collector, so you have to keep track of everything manually. That doesn't seem to bad at first, but when you start passing objects around, it quickly becomes messy. The two biggest issues you will run into here are segfaults from trying to access objects that have been completely released (thus the memory address to it is invalid), and memory leaks caused by not getting rid of objects that you don't need anymore. Also, whenever you get the basics down, go out and learn the Boost library. It does all sorts of cool stuff and will save you a lot of work. Good luck.
__________________
Twitter! |
|
|