C or C++ for game programming?

Started by
2 comments, last by Roderik 23 years, 11 months ago
Recently I decided to learn C++ programming, because I figured that it was the way to go, and everybody seemed to tell me that OOP is going to be the most important programing style in the future and so, plus I always wanted to know what OOP actually really is. Now, after learning C++, I am currently reading a book on windows programming and "Tricks of the windows game programing gurus" and so far I can''t see much OOP in these books, especially Andre Lamothe seems not to be so keen on C++...so what should I do (especially in terms of game programming)? Program in C? In C++? Combine both? I mean, after all I don''t wanna miss the Trend, and if in 5 years every single program is OOP, I don''t want to be the last man on earth programing in C...so which language would be the best for game programers?
--------------------------Ghosts crowd the young child's fragile eggshell mind...
Advertisement
Well, it''s not usually a descision made, based on restriction; I mean in ''the old days'' game programmers wrote games in languages that compiled to damn fast code (asm) because otherwise the game would be too slow, after processors got faster, moves to C were made, and everything was fine.
Now there is a fair amount of debate over the C/C++ issue for game coding, but it''s not (IMHO) a great deal. At the start of a project, you should make the descision of language, and stick to it. I can tell you that all the Quake series used a mixture of C and assembly - no C++, I can also tell you that Unreal/Unreal Tournament/Half-Life used C++ and asm (they probably had some pure C code in too) other games on the market - I am not sure; but the descision is not made on a restrictive basis anymore.
So, it''s really up to you, use whatever you are most comfortable with; I prefer the OO paradigm nowadays, I code in C++, and I refine the algorithms; I profile the code, see where the time is going, and if I''m absolutely sure that no further design improvements can be made; I might re-code the algorithm in C or even assembly (last resorts).

The above is simply my own view; I coulde be wrong; others could disagree with me; how you take it is your own descision.

Take it easy,

-Mezz

"The best advice anybody can give you is that you don''t have to take advice from anybody else."
From what I''ve heard, games written in C++ are barely any slower than ones written in C. Plus, they can be faster to write if you do some copying & pasting, and make good use of inheritance and templates.

lntakitopi@aol.com | http://geocities.com/guanajam/
The first time i saw what a class was, i found it very useless. I though using C was better than wasting my time with C++.

Now that i really know how to use C++, i really enjoy it and wonder how i could have written so much code in simple C!

If you like C++, use it! If you don't, use C! You won't do anything good with a language you dislike (er... i've never done anything cool in COBOL )

But even when you write C++, you can sometimes use pure C (or even asm), because it's more convenient for low level tricks. I use nearly pure C to code my half-hardware functions, but when i have to use a higher level of abstraction, i use C++.

And remember : NEVER USE COBOL!



Prosper / LOADED corporation

Edited by - Prosper/LOADED on May 18, 2000 6:26:41 AM

This topic is closed to new replies.

Advertisement