View Full Version : C++ or C#?

07-27-2008, 05:26 AM
I'm possibly interested in pursuing game programming, and I couldn't help noticing the "mainstream" companies (Blizzard, etc.) are looking for C/C++ programmers, rather than C#. What language would you guys recommend to someone who's never programmed before?

I've already got a book on C#. (http://www.amazon.com/Head-First-C-Brain-Friendly-Guides/dp/0596514824) If I start there, will it be more difficult to move on to C++ in the future? I've read about the pros and cons of each language, and it definitely sounds like C++ is the way to go for large scale game programming, but I'm just not sure if that's what I want to do.

Is C# the way of the future?

Thank you for any responses.

07-27-2008, 05:43 AM
C# is pretty easy to learn, but a good foundation in C/C++ can be very useful in picking up many enterprise languages.

I don't think it should be hard learning C# then C++, but you may get used to the garbage collector that it could be difficult to manually do memory management in C#

Mario F.
07-27-2008, 06:25 AM
For game programming I'd suggest C++. As you've noticed so do gaming companies.

07-27-2008, 06:38 AM
> and it definitely sounds like C++ is the way to go for large scale game programming,
For large programs, knowing how to program is probably more important than whether you can recite language reference manuals.

Writing large programs require a lot of skills which have nothing to do with programming languages.

07-27-2008, 07:35 PM
Right now the mainstream industry is C++. However you would do well to learn both. Both are great languages albeit used for different purposes.

Microsoft is attempting to make C# more popular in games via XNA and the nice portability that comes with it (that is between the PC and XBox 360) but I don't see a lot of hardcore game companies jumping into a managed language overnight. C++ is super fast and C# is close behind, and at times a bit faster for .NET, but mainstream games are already pushing the hardware to its max. Since every ounce of horsepower needs to be squeezed out of the machine I see most staying with C++.

C# would reduce dev time at most places but then again maybe it would not if most people at those places were experts at C++. The transition period would be costly in development hours and would probably peak and then level out somewhere below normal dev time for a C++ project. However the transition period would cost a lot of money and would not offer a lot of benefits right off which is why I think most game companies will stick with what has been working - IE: C++. It's hard enough to get the game to market as it is now and adding anymore risk or time to the equation is pretty much dev house suicide in the making.

For me it's not a matter of C++ or C# but a matter of C++ and C#. They are not mutually exclusive in my book.

Mario F.
07-27-2008, 08:26 PM
I've played a bit with XNA some 4 months ago and quiet frankly I wasn't very impressed. But it needs to be said I'm anything but an expert on the field, so my opinion may be flawed.

The first thing that stroke me as a strange was the platform requirements. I can't understand the requirements for the .Net framework 1.1 when 2.0 was already available in December last year. In fact, I'm still confused with the .net framework versioning system since obviously 1.1 and 2.0 are both different animals not compatible with each other.

Bad is the hardware requirements for shader model 2.0. This puts a lot of shareware and indie developers off since most don't follow the same pattern commercial companies do regarding technological achievements and hardware requirements for the finished product. There being a need for the XNA platform to gain a market in the Windows platform, I would think it would have been wiser to give room to the small entrepreneur. As is, the XNA platform seems to aim mid to high spec computers and mostly the XBox.

Meanwhile, while playing with it I couldn't help feeling I was simply coding on a thin DirectX layer. Maybe I'm wrong, but it felt like XNA is just a way to have you code DirectX in C#. Only difference now is that you will be doing it with managed code. Also, the level of support for XBox seems to deserve so much attention in the various documentation and the issue so much debated in Microsost's XNA website that I wonder how much of this is really intended for the Windows platform. Sure... something. But probably not as much as a game developer would have liked.

07-28-2008, 05:56 AM
If you've never programmed before, I wouldn't suggest game programming, at least not yet. I think a there is a common misconception among gamers that they must be easy to make because they're easy to play.