Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Roderik

C or C++ for game programming?

This topic is 6914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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."

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!