Jump to content
  • Advertisement

Archived

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

RageMatrix

C or C++? Opinions.

This topic is 6291 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

Hey all, I''m having some trouble with the design aspects of my game and this lead me to think about recoding what I''ve done so far in C++ rather than C. Would this make the game more "modular" and therefore easier to manage? From a design/implementation perspective, this is the largest project I''ve done. What are peoples opinions on C vs C++? Which do you use? Can anyone give me an idea of the kind of game "framework" that people here use in whichever language floats your boat? If it helps any, I''m using DX7.0 and its a 2D game. Opinions from the font of collective wisdom please! RM. -=Kicking Butt and Writing Code=-

Share this post


Link to post
Share on other sites
Advertisement
Personally I use C++ and object oriented design. But without starting a language war, just choose the approach that works best for you. I think more logically when I think in terms of objects rather than procedures. I also like to use software design tool, and UML to help me design my software. And those tools are built around object oriented programming.


This is also somewhat of a deciding factor, what does everyone in your group prefer. In my amature game group, we are C++ people. So any people in our group who may not have a preference, will end up using C++ and an object oriented approach simple because the rest of us are.


Also look at prolog and ada, I think these are the future of game programming j/k.

Share this post


Link to post
Share on other sites
Why on earth wouldn''t you post this flame-bait in the languages forum? Or search the archives for the 80,000 messages that have this exact same title?

Share this post


Link to post
Share on other sites
quote:
Original post by Stoffel
Why on earth wouldn't you post this flame-bait in the languages forum? Or search the archives for the 80,000 messages that have this exact same title?


Steady on! This isn't flame bait, but a legitimate question. I want to know which language you use and depending on your chioce, the game framework you use (file, structs, globals, classes, etc). I am having design/implementation problems with my game and wanted some outside input on languages/design considerations.

I didn't post this in the Languages forum because I felt that the design aspects of my question and possible answers made it off-topic. Frankly, I am slightly annoyed that I even have to explain myself to you.

I have NO wish to start a flame-war, but only wanted some input on this subject.

Why is everyone so hostile on GameDev lately?

RM.

-=Kicking Butt and Writing Code=-

Edited by - RageMatrix on June 22, 2001 6:55:58 PM

Share this post


Link to post
Share on other sites
C++ is better. My reason (Iread this in a book) is you know how ++ is the incremets an integer by one. Will lets say are variavle is C. Now if we wanted to incremnt one number up it would be C++. That is why C++ is better. Its the next step up. I like so much better because of classes and OO design. In C there is a brother of the class keyword, struct. The only difference it for classes everything is private by default and sturts everything public. Not to be a flame war of which is better C or C++. I just think C++ is best in this situation because of its OO design and classes. Its also has a lot more advantages. Well long, but that was my 2 cents

Share this post


Link to post
Share on other sites
It really doesn''t matter which way you go. With C you get an executable. With C++ you get an executable. I wrote the last version of my engine in C. The current one is in C++. It works they same way in the end.

Share this post


Link to post
Share on other sites
why on earth would anyone want to program with OOD??? It''s over rated! First off, C++ class function calls are slower that a straight function call! Second they suck to use and work with....why in the hell would you want a private member to!?!?!? I never understood that...sure it prevents someone from editting the variable from outside the class...but who gives a shit...if he does it his loss, his program could crash. The only nice thing I can think of about classes is the intellisense feature that msvc6 has, so when you type in the class and put the nice little [ . ] next to it, it gives a list of everything inside it. I don''t know why every one thinks OOD is so great, anything that can be done in C++ can be dont better with C

-Andrew

Share this post


Link to post
Share on other sites
quote:
Original post by RageMatrix
Steady on! This isn't flame bait, but a legitimate question. I want to know which language you use and depending on your chioce, the game framework you use (file, structs, globals, classes, etc). I am having design/implementation problems with my game and wanted some outside input on languages/design considerations.


Really? Not flame bait? See Assembler015's post, and the 20 posts that will follow saying OOD has merit, and the 20 posts that follow that saying nuh-uh.

quote:

I didn't post this in the Languages forum because I felt that the design aspects of my question and possible answers made it off-topic. Frankly, I am slightly annoyed that I even have to explain myself to you.


Frankly, I'm annoyed you didn't search the site. I'm tired of these bologna "which is better" posts. They're sophomoric, and all the sophomoric people drag the responses out for millenia. I'm hostile because I used to have a good time on this board, and it used to be useful, but that usefulness is quickly waning.

Look here:
http://www.gamedev.net/community/forums/topic.asp?topic_id=49938
and here:
http://www.gamedev.net/community/forums/topic.asp?topic_id=49109

..for answers to your question that have been beaten to death, not to mention the first friggin' line of the FAQ .

quote:

I have NO wish to start a flame-war, but only wanted some input on this subject.
Why is everyone so hostile on GameDev lately?


Becuase |33+ HAX0RS who are "kicking butt and writing code" who don't even know the difference between C and C++ keep asking stupid questions without doing any research on their own, and then all the other |33+ HAX0RS have to put in their two cents--those opinions being worth slightly less than the electricity it took to run their browser for the time it took to punch out their meek response.

Edited by - Stoffel on June 22, 2001 8:22:58 PM

Share this post


Link to post
Share on other sites
assembler:

"why in the hell would you want a private member to!?!?!? I never understood that"

Exactly, you don''t understand it therefore you don''t like it and are uncomfortable with it.

"but who gives a shit...if he does it his loss"

Well, if one department in a co. makes a library and another department uses it. It would make sense to try and keep the using department from fucking themselves over.

"anything that can be done in C++ can be dont better with C"

I assume you mean ''done better''. I disagree, simulating c++ features in C leads to ugly inelegant and probably wasteful code.
Your better off just doing it the C way and not trying to simulate c++ features in C.


ECKILLER

Share this post


Link to post
Share on other sites
The main benefit I think you would get from using c++ in your project would be in enforcing modularization. There are a number of language constructs such as namespaces and classes which work towards this.

While it is possible to modularize in c, it involves discipline on the part of the programmer and ( probably ) awkward naming conventions. In c++, once you have learned the syntax and how classes etc... work, it all comes naturally.

The main thing is that on a project of reasonable size using modules becomes a must and thats where design comes in. What ever method you use it must be stuck to. C++ just makes it easier to do this.

Also, just because you use c++ does not mean you have to use all the OO features. If your worried about speed, then dont'' use inheritence and virtual method stuff. 80% of the time it''s not needed anyway.

point being: it''s not the tool''s you use, it''s how you use them.

thi sis my si gitzt hebezt

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!