0
\$\begingroup\$

I have been researching three different programming paradigms namely procedural, object oriented and functional. So far I have been able to find a lot of good information regarding general differences and advantages/disadvantages like readability, re-usability, difference in learning curve, program size, etc.

I am now looking for differences more related to game programming, but I am struggling to find good examples. Does anyone know of specific issues when programming games that these paradigms handle differently, that I could look into? This could include things like handling I/O, rendering and programming AI, but other things related to game programming would also be appreciated.

\$\endgroup\$
1
  • \$\begingroup\$ In reply to the question being put on hold and good answers being too long for this format. Sorry if I was not clear in the OP (English is not my first language), but what I was looking for was someone to point me in the right direction in terms of what to look for or give me some keywords that I could use when searching, to help me find some better results. If the question is still not suitable in that context, I am sorry. \$\endgroup\$ Commented Sep 19, 2014 at 15:44

1 Answer 1

1
\$\begingroup\$

Procedural maybe the fastest way in CPU speed terms, but would be also the worst to work with. Games in AI and Physics have a lot of code, and controlling such things with a ton of function calls can be very frustrating to maintain the code for later use and reuse.

Functional is the the most slow in CPU speed terms, and you should totally avoid these in 3D games and any game with too many entities and mechanics. Keeping 60FPS is a hard work and in a game it's one of your highest priorities.

OOP is great! Sometimes hierarchy of the objects and type casts can be a bit slow than rather calling some functions, but the simple way of keeping things make the code a lot easierr than a procedural. Of course, Interfaces can be useful, but those means some overload on the CPU, and you should keep track only on hierarchy of the classes. Here is a example of a lib for AS3 game programming totally made in OOP: https://github.com/useflashpunk/FlashPunk

This idea is so great that people tried to make derivations in other IDEs like Starling(Punk) and Haxe(Punk).

I'm not into 3D game programming, so I can't make examples about it for you, but I think that 2D is enough.

\$\endgroup\$
1
  • \$\begingroup\$ Remember to mark this as the answer if you're happy with it. Also, its more than just choosing between functional, oop, etc, there are patterns within each that should be followed. Check this out: gameprogrammingpatterns.com \$\endgroup\$ Commented Sep 19, 2014 at 13:04

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.