Skip to main content
GameDev.net gamedev.net
🔒 Locked

C# vs C++... yet again...

Started by Lovens Jan 10, 2009 at 5:51 AM 10 replies 2.5k views
Original Post
Lovens
Lovens
Hi guys, would like your opinion on this one. I would like to know if it is a wise choice to choose C#/XNA for my current project. We are a small team now and I always thought that it would be nice to use this technology because of XBox live community games. By putting our game there we could get noticed right? What are the pitfall of doing that? Is it as easy and beautifull as it seems? My other choice would be to do the game for Windows PC with C++ and DirectX 9 or 10. I have lots of experience in C++ (so do my gfx programmer), and of course it's wayyy better for performance. Many game compagny use it as the De Facto standard, etc... But it's been like 1½ years that I was in C# and I'M close to having a playable prototype. Should I just trash all this code and start in C++? Waiting for some good opinions...
________Lovens "CAPONE" WecheProgrammer
ToohrVyk
ToohrVyk
You have two alternatives: going on with C#, or starting all over again with C++.

Your objective is, I suppose, to release a playable game as soon as possible. So, the tie breaker here is, which approach lets you do that faster?

Consider the time it takes to complete and optimize your C# code to reach a good playability level, and the time it would take to rewrite, complete and optimize equivalent C++ code to reach a good playability level. Then, choose the option with the list time.
Lovens
Lovens
Quote:
Original post by ToohrVyk
You have two alternatives: going on with C#, or starting all over again with C++.

Your objective is, I suppose, to release a playable game as soon as possible. So, the tie breaker here is, which approach lets you do that faster?

Consider the time it takes to complete and optimize your C# code to reach a good playability level, and the time it would take to rewrite, complete and optimize equivalent C++ code to reach a good playability level. Then, choose the option with the list time.


Yeah I know that but what it all come down to is: For those who developed Xbox live community games, is it worth ditching C++ for it???
________Lovens "CAPONE" WecheProgrammer
ernow
ernow
To answer that you need to define "worth".

For some it will be "fun" or "time" or even "money".

What is it to you?
DevFred
DevFred
Quote:
Original post by Lovens
I have lots of experience in C++ [...] of course it's wayyy better for performance.

C# isn't as slow as you make it sound.
swiftcoder
swiftcoder
Quote:
Original post by DevFred
Quote:
Original post by Lovens
I have lots of experience in C++ [...] of course it's wayyy better for performance.
C# isn't as slow as you make it sound.
And even if it was, it would only be a problem if you end up CPU bound - not a particularly common occurrence from my experience.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
Lovens
Lovens
Quote:
Original post by ernow
To answer that you need to define "worth".

For some it will be "fun" or "time" or even "money".

What is it to you?


Well I know C# isn't that slowww but C++ is better plus you can have x86 ASM code for those tight inner loops (I miss coding in ASM). I know I know with algorithmic optimzations and compiler optimizations who needs ASM... But I miss it anyways.

In XNA (3.0 I think) can we use ALL the features that DirectX 10 offers?

If I apply for a job, and they look for a C++ programmer, all my C++ code dates before me even knowing what a design pattern was! So I technically have nothing to show. So if my project is in C++, a nice demo right?

There are soooooooooooooooo many API, Middleware, etc for C++. For C#??? Because I coded everything from scratch, and for my current project I want to use middleware as a good practice.
________Lovens "CAPONE" WecheProgrammer
stonemetal
stonemetal
Quote:
Original post by Lovens
Hi guys, would like your opinion on this one.

I would like to know if it is a wise choice to choose C#/XNA for my current project. We are a small team now and I always thought that it would be nice to use this technology because of XBox live community games. By putting our game there we could get noticed right?



That is quite a big pond full of games you are dropping it in to. Are you doing advertising to get it noticed or is it a build it and they will come scenario?

Notice is not something you "get" it is something you have to manufacture.
Mike.Popoloski
Mike.Popoloski
It sounds like you want us to force you to use C++, but you've already received the correct answer to your question: weigh your desire to produce a finished game against your desire to use the "best" language and see which option you prefer more heavily. We aren't going to do your thinking for you; you need to grow up and make your own decisions now. The best we can do is correct any factual inaccuracies you may harbor so that you can have the best possible information before making your decision. On that note...

Quote:
In XNA (3.0 I think) can we use ALL the features that DirectX 10 offers?

No, in all versions of XNA you can only make use of Direct3D9, and perhaps some of the extended features offered by the Xbox360's graphics chip.
Mike Popoloski | Journal | SlimDX
Lovens
Lovens
Quote:
Original post by Mike.Popoloski
We aren't going to do your thinking for you; you need to grow up and make your own decisions now.


Ok I'm sorry, I had the impression that on this site we could get some advice from fellow programmers who had the same choices in the past.

I'm sorry for that...

Note: a friend of mine told me that he never posts here. I think it really sad, lots of people simply want help... Anyways great site anyways gamedev.net :-)


________Lovens "CAPONE" WecheProgrammer
Mike.Popoloski
Mike.Popoloski
Quote:
Original post by Lovens
Ok I'm sorry, I had the impression that on this site we could get some advice from fellow programmers who had the same choices in the past.


You've already received your advice. ToohrVyk laid out the path you should take, and DevFred and swiftcoder each corrected some of your misconceptions, so now all you have to do is make a decision. What you want now is for us to make that decision for you, which as I said before is not GDNet's business.
Mike Popoloski | Journal | SlimDX
sirpalee
sirpalee
You need to decide what you want to do, with your game.

If you need reference for a job application, C++ is far more better than XNA and c#.

Yes you can sell your game to xbox live (if you live in the right country), but there are a lot of limitations when it comes to selling your xna game either on pc (license problems) or on xbox 360 (size considerations, and so on).

If you decide to work with the pc, don't consider using DX10, if you can limit yourself to vista, use DX11. The preview is already out there, most of the features are already working, and it's backwards compatible even with dx9 (and giving you an unified api, and set of features).

With C++ you won't run into any limitations, and if you're an experienced C++ coder (as you mentioned above) you won't have any problem working with DirectX.

However..

Using c# is simpler than c++, especially with garbage collection, and the combination of xna and the .net library. You can make a working game much more easier with xna, but as the game get more complex, you'll run into the language limitations (performance, usage) more and more often, than you can imagine.

If I were you, I would go with C++, because the opportunities, and since there are no limitations, using c++, you can do whatever you want to do. Of course it's harder, and you'll lose a lot of time debugging you code and finding memory leaks (assuming that you are as lazy as me).

That's all, good luck with your development :)
shaken, not stirred

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.