Sign in to follow this  
Corrob

C# and XNA vs. C++ and SDL

Recommended Posts

Corrob    126
Hello, this is my first time starting a post. So far I have learned some C# and some C++. I was wandering should I stick with C# and learn XNA or go with C++ with SDL.

Share this post


Link to post
Share on other sites
NickGravelyn    855
Whichever you prefer. Neither one is better or worse than the other.

I recommend C# and XNA for a number of reasons. First having the garbage collector makes beginning game programming (and even intermediate level) much easier. A lot of that helps you then learn a lot of graphical and gameplay-related programming topics that are, in my opinion, trickier to learn in C++ if you are not very experienced.

Platform availability is also a big difference between the two of those. With XNA you can make games playable on your Windows PC and your Xbox 360. With SDL and C++ you can make games for Windows, Linux, and Mac OS X.

Share this post


Link to post
Share on other sites
Corrob    126
Thank you very much for your reply.

From what you said I think I will go with C# and XNA because I am not experienced. I still welcome other peoples replies. Thank you.

Share this post


Link to post
Share on other sites
Pzc    216
I agree with NickGravelyn and recommend C# + XNA since you're saying that you don't have much experience with either C# or C++. C# is a lot easier to get started with and do some productive things when you're starting out compared to C/C++.

Share this post


Link to post
Share on other sites
shou4577    184
Well, I thought that I would just post my two cents here.

C++ isn't nearly as hard to learn as a lot of people claim it is. It may not be the easiest language to learn, but it is certainly very versatile. On top of that, you can find tutorials on C++ (and SDL, to a lesser extent) anywhere. There is simply a really large number of programmers that know it. So it is a bit harder, but it was my first programming language, and I'm doing just fine.

As for SDL, I'm only just starting it, and I absolutely love it. When they say Simple DirectMedia Layer, they put the emphasis on Simple. No joke, SDL is really easy to pick up.

Now, I have never used C# or XNA, so I can't say that C++ and SDL is a better option, but I can tell you that C++ and SDL makes a really good option. And somebody had to show some love for the other side on this topic.

Brian

Share this post


Link to post
Share on other sites
godsenddeath    182
Quote:
Original post by shou4577
Well, I thought that I would just post my two cents here.

C++ isn't nearly as hard to learn as a lot of people claim it is. It may not be the easiest language to learn, but it is certainly very versatile. On top of that, you can find tutorials on C++ (and SDL, to a lesser extent) anywhere.


i'll have to agree, i mean i'm far from an expert but i didn't have much trouble at all getting used to C++, i'm not saying C++ is better, because from what i gather what language is best depends on the situation, but the difficulty of C++ seems to be greatly overstated.

i've been programming for 8 only months or so and i've put together a handful of 2D games using C++ w/ SDL. that being said, i don't know much about C# other than dabbling in it from time to time.

everyone has a bias, ie. for everyone who pushes for C#, you'll notice that its the prefered language of that person, and the people who are really familiar with a bunch of different languages tend to be the ones who tell you to just choose one and stick with it.


Share this post


Link to post
Share on other sites
acddklr07    145
Hello,

Most people, who have been game programming for a while, would recommend for you to either start with Python or C# and I would second their opinion. Both Python and C# are easier for beginners to start off with. They both have ways to make graphical games and that is Pygame(for Python) and XNA(for C#). I have never used Pygame before so I can not vouch for that, but I have used XNA before. XNA is x100 easier to learn than SDL, DirectX, or OpenGL in my opinion.

I would recommend you not to learn C++ first. Trust me on that because I actually learned it first. C++ is a monster language to try to learn first. Both C# and Python will teach you how to program without worrying about a lot of crazy things. One of those things is garbage collection, which is hard to make sure you do properly.

Anyways choose either Python, C#, or some name language on your own choice and make sure you learn the language first and then learn either Pygame, XNA, or what ever graphics thing for the language you chosen. Then start programming games, and when you are ready you should delve into the vast realm of C++ but that is only when you are ready. Anyways I wish you much luck with your programming experience and hope to see some of those games :)!

~Sincerely,
Carl J. Loucius

Share this post


Link to post
Share on other sites
thedustbustr    191
I don't know C#/XNA, but I've hacked up a pretty simple engine in C++/SDL/OGL. I wouldn't do it again, even though I am now decent with C++ (1 yr professional experience). You just spend far too much time debugging memory issues, even as an intermediate-level developer. Jump into a managed language and you no longer have to worry about stuff like that - you get to spend your time writing logic, and not wasting entire days debugging crap that you don't care about.

Debugging is not fun. Writing code is fun. Writing code in C++ means more time wasted on the frustrating, boring part of programming.

Share this post


Link to post
Share on other sites
Corrob    126
First, I want to thank everyone who has given me advice!

Well, I tried installing XNA and running the sample game but XNA won't run on my computer because I don't have Shader 2.0 on my graphics card. I'm gonna get a new graphics card in a couple of months with Shader 2.0. I'll try XNA at that time.

Quote:
Original post by acddklr07
Hello,

Most people, who have been game programming for a while, would recommend for you to either start with Python or C# and I would second their opinion. Both Python and C# are easier for beginners to start off with. They both have ways to make graphical games and that is Pygame(for Python) and XNA(for C#). I have never used Pygame before so I can not vouch for that, but I have used XNA before. XNA is x100 easier to learn than SDL, DirectX, or OpenGL in my opinion.


Thank you for the advice about Python but I have already made a couple of games with Python and Pygame. I also have learned the basics of both C# and C++. I am ready to learn API's with both languages. So right now I'm going to learn SDL with C++. When I get the new graphics card, I will try XNA and see which one I prefer.

Thanks again,
Corrob

Share this post


Link to post
Share on other sites
superpig    1825
Quote:
Original post by shou4577
On top of that, you can find tutorials on C++ (and SDL, to a lesser extent) anywhere.
Correction: You can find really, really bad tutorials on C++ anywhere. It's quality of material that matters, not quantity. Once you reach a certain level, you can read the vast majority of programming languages without "learning" them anyway, so the fact that the code for a particular article on topic X is in C++ won't stop a C# coder who's reached that level.

Quote:
There is simply a really large number of programmers that know it.
Most of them don't know it very well. Check out some of Washu's quizzes - here (with followup), here (with answers), here and here (answers) - all fairly simple expressions but the majority of people get the answers wrong.

Besides, there's lots of people that smoke cigarettes, too...

Quote:
I can tell you that C++ and SDL makes a really good option.
But without anything to compare it too, "good" is meaningless.

Quote:
And somebody had to show some love for the other side on this topic.
No, they didn't [grin]

Share this post


Link to post
Share on other sites
NickGravelyn    855
Quote:
Original post by Corrob
First, I want to thank everyone who has given me advice!

Well, I tried installing XNA and running the sample game but XNA won't run on my computer because I don't have Shader 2.0 on my graphics card. I'm gonna get a new graphics card in a couple of months with Shader 2.0. I'll try XNA at that time.

Thanks again,
Corrob


SpaceWars requires Shader 2.0, but XNA as a whole only requires Shader Model 1.1. If you create a new blank Windows game project you should be able to run that if your card supports it.

Share this post


Link to post
Share on other sites
Corrob    126
Quote:
Original post by NickGravelyn
Quote:
Original post by Corrob
First, I want to thank everyone who has given me advice!

Well, I tried installing XNA and running the sample game but XNA won't run on my computer because I don't have Shader 2.0 on my graphics card. I'm gonna get a new graphics card in a couple of months with Shader 2.0. I'll try XNA at that time.

Thanks again,
Corrob


SpaceWars requires Shader 2.0, but XNA as a whole only requires Shader Model 1.1. If you create a new blank Windows game project you should be able to run that if your card supports it.


Thank you for this information but unfortunately my graphics card doesn't even have Shader Model 1.1. The graphics card that I plan to get in a couple of months has Shader Model 3.0.
Quote:
Original post by superpig
Quote:
Original post by shou4577
On top of that, you can find tutorials on C++ (and SDL, to a lesser extent) anywhere.


Correction: You can find really, really bad tutorials on C++ anywhere. It's quality of material that matters, not quantity. Once you reach a certain level, you can read the vast majority of programming languages without "learning" them anyway, so the fact that the code for a particular article on topic X is in C++ won't stop a C# coder who's reached that level.


Quote:
There is simply a really large number of programmers that know it.


Most of them don't know it very well. Check out some of Washu's quizzes - here (with followup), here (with answers), here and here (answers) - all fairly simple expressions but the majority of people get the answers wrong.

Besides, there's lots of people that smoke cigarettes, too...


Quote:
I can tell you that C++ and SDL makes a really good option.


But without anything to compare it too, "good" is meaningless.


Quote:
And somebody had to show some love for the other side on this topic.


No, they didn't

As I said before, I will try C++ and SDL for now until I get the new graphics card. When I get it I will try C# and XNA and see which one I prefer. Thanks for you help though!

Share this post


Link to post
Share on other sites
My two cents: There is effectively not a single good reason to use C++ in and of itself.

I should note here that I'm a professional game developer who uses C++ every day, so I'm not just saying this because I hate C++ for no good reason. There *are* legitimate reasons to use it, but they have nothing to do with the language itself (if you have large amounts of legacy code, or lots of legacy programmers).
If you're starting from scratch and have a choice, there is no reason cause yourself any extra problems - I'm sure you'll find more fun things to spend your time on than chasing down memory scribbles and doing manual book-keeping of various sorts. Trust me, game development can be very complicated, and you should take any help you can get from the tools!

Share this post


Link to post
Share on other sites

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