Jump to content
  • Advertisement

Archived

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

evergrowgames

Is Procedural Style code viable for Game Programming?

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

I am using C++, and would like to know whether or not components which are used for OOP such as classes are needed to create (good) games. I prefer procedural(C) style code, of using functions instead. I feel more comfortable using it, and it is(in my [maybe wrong] opinion) easier to integrate into a scripting system(by which I mean I can call funcions from scripts easier than member functions in classes. Of course I may be wrong about that). Therefore, I have three main questions: 1) Is procedural code viable for game programming? 2) What are the benefits/problems with both Object Oriented and Procedual coding in games? (The following question is less important, and may sound stupid as I haven't read the book in its entirety) 3) Would a scripting system similar to the one described in "Game Scripting Mastery" by Alex Varanese be able to use member functions for host API function calls? Would it be easy or difficult? [edited by - evergrowgames on August 17, 2003 6:15:19 PM]

Share this post


Link to post
Share on other sites
Advertisement
<< I prefer procedural(C) style code, of using functions instead. >>

Me too, but I''m old school, been programming for 20+ years. Do what you feel is comfortable and readable that helps you organize your code. The Dooms/Quakes are all straight C. I was told the Doom 3 engine by Carmack is straight C also, with other people adding some C++ OO stuff. The advantage of OO programming is the modeling of objects more like the "real world."

Phil P

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The real power of C++ is that unlike many other languages, you are free to mix and match programming styles, to always use the best style for the task at hand. I usually end up writing my programs in a mix of object-oriented and procedural programming.

Share this post


Link to post
Share on other sites
Thank you for the great replies! This is beginning to affirm what I thought! But please, if anyone else want to reply, please do so! I would like as many opinions as I can get, espcecially on the advantages/disadvantages of both!

Share this post


Link to post
Share on other sites
I tend to write sloppier code when I code in a procderal style, so for big projects I use C++. It''s not that you can''t wirte bad C++ code (you can I''ve done it), but C++ forces ou to structure you code a certain way. You can do the same thing in C, but the language won''t for you to do it, so if your like me you get lax

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!