Sign in to follow this  

Game Development C/C++ questions

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

Hello, I have been learning C++ for the past few months now and focusing on or towards game development. I have a few questions that i tried searching answers for, with no actual good results. I was like it if i could get your opinions on the questions below.

1. It seems as if with C++, the solution to ever problem is OOP, but what are some situations where you should not use OOP.

2. What other paradigms that are used commonly in game development. I have been reading up on Data-Oriented Design/Programming the past week(DOD), so are there any others?

3. Is C still used commonly in game development on platforms such as PC and major gaming consoles or is it used more on protable/embedded devies such as the DS/PSP/Vita/etc. Or is it a mix of C and C++ depending on what you are currently programming such as UI, the core, etc.

4. Realted to question 3, is C still used quite a bit in game development

5. Are many features of C++ used commonly or do most companies put strict rules on what features to use and what features not to use.



Those are my questions for now. If i think of any that i missed i will edit the post. Thanks. Edited by Max707

Share this post


Link to post
Share on other sites
I don't have much to add as Apoch pretty much nailed the answers. I do believe there is one time that a C/C++ mixed codebase is acceptable which is when moving from a C codebase to C++ over time in production... although that is why he stated "generally" [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Regarding #5 the standard library is often outlawed as well with the reasons being memory allocation (nobody likes shoehorning with the STL allocators), people not paying attention to what is happening internally, and wading through template errors. I don't think anyone mentions performance anymore these days, other than programmers not thinking about the properly and/or not using the containers properly. With C++11 having move constructors / assignment it just makes the containers perform even better in many cases. So in reality if you look at the main reasons the STL is normally outlawed it is strictly due to end-user error and not the library itself.

Share this post


Link to post
Share on other sites
"C++ is a [url="http://www.research.att.com/%7Ebs/bs_faq.html#multiparadigm"]multi-paradigm programming language[/url] that supports Object-Oriented and other useful styles of programming. If what you are looking for is something that forces you to do things in exactly one way, C++ isn't it. There is no one right way to write every program - and even if there were there would be no way of forcing programmers to use it."

See also:
http://www2.research.att.com/~bs/bs_faq.html#multiparadigm
http://www2.research.att.com/~bs/bs_faq.html#Object-Oriented-language
http://www2.research.att.com/~bs/bs_faq.html#generic
http://www2.research.att.com/~bs/bs_faq.html#oop

Share this post


Link to post
Share on other sites
Thank you to everyone who answered. If helped me out alot and as like Apoch said, whenever you try to research these topics it is just a heated argument with no backbone for either side. Just screaming into a massive void. Thanks again and re-enforcing the fact to always follow you curiosity/itch if something does not seem right and that there has to be a better way to solve this problem. Edited by Max707

Share this post


Link to post
Share on other sites
Regarding question 5:

During my studies at my previous university, our professor loosely enforced Google's C++ style guide. It could prove to be pretty helpful if you're ever unsure about some C++ usages. Although I'm definitely a newbie, I always keep this in my browser as a reference!

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

Share this post


Link to post
Share on other sites

This topic is 1990 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this