To "C "or not to "C++"

Started by
5 comments, last by a_insomniac 23 years, 6 months ago
I have experience in other languages, visual basic, perl and java script,(used at work) but I switched to C for game dev and have been coding in it for about a year or more. But I first started off trying to learn C++ first. I would see alot of small *tip sections that stated, learning C first would be a better approach at learning C++. So I took that route. Needless to say I love C. I could go on talking about C but I wont. My question is this. I have programmed my first game. (---play applause track here---) small but Im happy with it, and I can see where C++ would help. You know inheritance, classes, the whole OOP bit. QUESTION: Is the transistion between C and C++ really that difficult and is it common to mix the two while coding, if its even practical. (Thinking of switching for more control flow and structure over my code, just looking for opinions) a_insomniac If my compiler was voice activated with the voice of my mother-in-law....there would be no errors!

----------

Advertisement
C++ is a lot easier than you think, even easier than C IMHO. I still use C functions, but use C++ code structure for better performance.

JoeMont001@aol.com www.polarisoft.n3.net
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
Heya, I cant understand peoples reasoning about C++ being like a totally different language.

Its just an extension of C, which gives you some extra tools which (GREATLY) help data structure management mainly. Its actually pretty easy to convert someones C code (eg structs) to C++ (classes).

Grab an intermediate C++ textbook or the C++ for Dummies, which explains C++ to people who know C already. Learn classes and pointers and you will be on the way

Cel
Cel aka Razehttp://chopper2k.qgl.org
I agree with the posts previous to my own, C++ is just some more code for C. You can still do all the same stuff, except you use a C++ compiler, have .cpp files, and get all the new features .

Null and Void
"In this house we obey the laws of thermodynamics!" --Homer Simpson
Hmmm, well im glad to here that it is like that, I already know pointers fairly well and I figured the part about structs to classes.
What gets me is when people say. "The difficult part is getting someone to think in terms of Objects" being object oriented .

Thats what makes it seem like a totally different language because of style change and Modular to Object oriented style of thinking .

a_insomniac

----------

I still have trouble deciding how my object should interact, I always end up with pointers to parent objects in my contained classes. It seems to snowball too, you add this function that calls the same type of function in that class, and that class calls yet antoher same-type function in some other class...
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
The easy part is the syntax and new constructs.

The hard part is using objects to their full advantage.

Sure you will be able to create some classes and have other classes interact and blah blah, but it will take time to really see that using them in certain ways makes your systems so clear and ''simple''

There is a book that I have just read called DESIGN PATTERNS, and it is not until reading this that I have finally gone AHA! - this OO stuff is amazing.

If you can afford it go and get it - it will not teach you any syntax - you are expected to know it - but it will show you what a real OO system is.

Have fun

This topic is closed to new replies.

Advertisement