Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XNA vs a C++ Engine [closed]

Tags:

c++

c#

xna

I realize that this is the sort of question that tends to result in arguments, but because I never learn, I'll ask it anyways:

I'm a Computer Science student with a couple years of experience who is currently looking into doing more serious work with game development. Thus far I have about half a year's knowledge of C++ and Java and a year and a half of C#. I've worked a lot with the XNA framework, but in looking around for advice, I've found a lot of people suggesting that C++ or Java is a better place to start for building games.

So my question is this: Given that I already am comfortable with XNA, what are the major disadvantages inherent in the format that would be avoided by instead using C++/Java?

When answering with regards to optimization and such, please consider my current lack of experience. Telling me that an optimized C++ program is faster than an optimized C# program is meaningless to me if that optimization requires an expert programmer to implement.

Edit: Allow me to rephrase: My question is not "Why should I use C++?", it's "Why should I not use XNA?" I'm aware that C++ will give me more options, but my question was whether or not those options are useful enough in amateur game design to be worth seeking out C++ immediately.

like image 879
Falterfire Avatar asked Mar 05 '26 17:03

Falterfire


2 Answers

The advantage of using C++ is that you can do literally whatever you want.

Another advantage is that the C++ might be faster, in tight loops where you are doing a lot of math where the C# equivalent is using a lot of little structs.

The disadvantage of using C++ is that you will be programming in C++. This means memory management woes, pointer dereferencing bugs, and all kinds of unmanaged problems that you don't get in .NET.

Another disadvantage is that you don't get support for XBox or Windows Phone that you would get with XNA.

like image 161
Mike Caron Avatar answered Mar 08 '26 06:03

Mike Caron


Okay, so let's completely ignore the argument which one is better. Let's go with the assumption you wish to pursue a career in game development.

I am going to be straight forward and say that 90% of games, if not more, are developed using some portion of C++ (either the complete thing, a framework, libraries, etc) so learning C++ would be essential to any game developer.

If you are doing it purely for a hobby XNA is a fast way to get in the door without learning the other programming elements (such as 3D graphics, file management, etc). However that being said, learning that stuff is also key.

So, to sum up, my suggestion is to learn C++. There is no reason not to. If you know C++ you can learn C# in half a second (well not really, but fairly quickly). Once you have an understanding of the basics (3D programming, physics, etc) you can do pretty much anything.

Good luck.

like image 34
Steven Avatar answered Mar 08 '26 06:03

Steven



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!