[c#] Should C# or C++ be chosen for learning Games Programming (consoles)?

I've basic game programming knowledge in c and c++. I'm learning c# nowadays. If I want to make a career in console games programming, which one I should use to proceed? I've noticed that a lot of game companies are using C++/C (probably because of legacy reasons). Also probably C++ enjoys more number of supported libraries?
In which languages modern game engines(unreal/crysis etc) are written in?
Which language is a better bet? and why?

This question is related to c# c++

The answer is


C++ is the lingua franca of the console game industry. For better or worse, you must know it to be a professional console game programmer.


If you knew C# and XNA, you could make some sample games in a pretty straight forward manner, which might help to break into the field.

My guess is, the core gaming engines are written in C++, but some of the other code around the core could be in C#.


C++ with win32/GDI is relatively easy to get going, but far more difficult than say Flash or Python (pygame) - however, by using C++ you'll learn a lot in the process and be well poised to continue advancing your career as a game developer. You can also look into XNA if you want to program to the xbox360.

I took some classes at Game Institute (GI) and learned a lot about C++, win32 API and DirectX.


I think that C++.

Because c# needs additional instalation for C# runtime which only absorbs space on a disk. And C# is of course a bit slower.


To tell the truth...you have to make the decision as to which is the better language. I know what I can do with C#. I know what can be done in C++. C# isn't made to do what C++ was made to do...write code at the most basic level and still be somewhat meaningful when read by human eyes.

We are developing a game engine with C#, DirectX...is it a challenge? hell yeah...but it's something we chose to do. We are looking at some performance levels that are very close to what C++ can give. So, I see no problems with this effort.

To cross-platform development, if it weren't for .Net, we might not have the Mono platform. The Mono platform has broadened our platform base.

Here is some support to my arguments...


It really depends on what type of game you're planning on building: many games could be done in a language like C#. That being said, the majority of game development is done in C++ just becasue the majority of game development needs to eke out every last bit of performance that the platform can provide and that means either C, C++ or (shudder) assembler.


I'm not going to answer the original question since most post here have. I'm going to point something out to you that you missed in your post. Simply knowing C\C++\C# isn't going to get you a career in game development. Most game studios get dozens to hundreds of applications for a simple code monkey job. What makes you stand out compared to them? What makes you a better hire than someone else who has experience making games at another studio?

If you really want a career in the games industry, even on consoles, you should make a demo of some kind that shows what you know. C++ would be great language choice to use in the demo if you're applying for a console development position. You could show off more by making a tool in C#\XNA to create the assets for your demo. You'll show the hiring managers and tech leads that you're not JUST a C++ guy or JUST a C# guy: you're a developer.


Look at it like this - while you can write a game in C#, it isn't going to open many career doors for you. If you know C++ and Lua, then you're going to be far more employable.

You're also not just talking about PC desktops and Consoles, games nowadays are very much for the mobile devices, so only knowing C# would limit you even further. Sure, C++ isn't going to be the optimal choice for writing iPhone apps, but you're going to be far closer to being an objective-C programmer if you know C++ than if you know C#.

Games devs use C++ not for legacy reasons (though having establish C++ engines and libraries helps) but for performance and experience. Game devs know C++, it works for them very well, so there's no need to change. Its not like line-of-business apps (on Windows) where the developer mindshare moves with the current Microsoft tools.


Its always a hard one to say because they were using assembly up until 1993, NBA Jam if anyone remembers that bad boy. Technology is constantly trending so its very difficult to say where it will go, I would recommend learning C and getting a very firm grasp on that then move onto C++. I will say this as a caution if you enjoy playing games you will not enjoy coding games.


You won't find C# running on any consoles, so it's useless in that regard.

If you are learning programming, C# offers a softer learning curve than C++, but you can write C++ without getting into the more scary and complex areas of the language, so it's not really much more difficult.

If you want to program with graphics or other "gamesey" things, then C# is a pretty poor choice - go for C++ with OpenGL or DirectX.

edit

Ultimately, if you want a career in games, go for C++. You may be able to write game code in C#, but realistically you won't find nearly as many career opportunities using C# as you do with C++. Unless you want to become a game tools programmer, in which case C# is much better than C++ because you can get a lot more functionality working in a lot less time. A lot of games companies are switching to C# for as much tools dev as possible.

Of course, if you can handle the workload, the best way is to learn both languages, and apply "the best tool for the job". As they're so similar, it's really not difficult to learn one when you've learned the other. (Really most of the learning curve moving from C++ to C# is .net and LINQ etc rather than the core C# language per se - an awful lot of it is nearly identical, with just a few bits of syntactical sugar here and there)


Hey, if BASIC is good enough for Gorillas, it's good enough for me.


There is no one language that is a "better bet." Use the language most appropriate for what you need to do, whether it is game programming or any other domain. C++ isn't going away anytime soon.

If you're not developing for a Microsoft platform, I doubt you'll use C#.


Ok here is my two cents.

If you are planning to seriously get into the game industry I recommend you learn both languages. Starting off with C++ then moving into a managed language like C#. C++ has it's advantages over C#, but C# also has advantages over C++.

Personally I prefer C# over C++ any day. This is because many reasons:, just a few:

  1. C# makes programming fun again ;).
  2. It's managed code helps me complete complex tasks easily and not forget safety.
  3. C#s' is pure OOP, forcing rules in your code that helps keep your code more readable, 'maintainable' and execution is more stable. Productivity rate surpasses C++ by at least 10%, the best C++ programmer could be an even better C# programmer.
  4. This isn't really a reason, more like something 'I' like about C#: LINQ.

Now...there are many things that I miss about C++. I miss being able to (completely) manage my own memory. I can't tell you how many times I caught myself trying to 'delete' an instance/reference. Another thing I dislike about C# is the inability to use multiple-inheritance, but then again it has forced me to think more about how to structure my code.

There has been more discussions on this topic than there are stars in the known universe and they all close at a dead end. Neither language is better than the other and refusing either one for the other will just hurt you in the long run. Times change and so do the standards for computer programming.

Whatever language you choose to keep at the top of your list, always keep your options open and don't set your mind to any one single language. You say you already know C++, why not learn C#, it can't hurt and I 'promise' you, it will make you a better C++ programmer.


It depends

It depends on a lot of things - your goals, your experience, your timeframe, etc.

The majority of game programming isn't language specific. 3D math is 3D math in C# as much as it is in C++. While the APIs may be different, and different 'bookkeeping' may be required, the fundamental logic and math will remain the same.

And it's true that most AAA game engines are C++ with a scripting language on top of them. That is undeniable. However, most AAA engines also have a bunch of in-house tools supporting them, and those may be in anything - Java, C#, C++, etc.

If you want to write a game, and are an experienced developer then C++ and C# have a lot going for them. C# has less housekeeping, while C++ has more available libraries and tools. For anything highly complex, however, you'd be best off trying to use an existing engine as a starting point.

If you want to write a game, and are a new developer then don't write an engine. Use an existing engine, and mod it or use its facilities to write your game. Trust me.

If you want to learn how to write an engine, and are an experienced developer you should probably think about C++. C# is possible as well, but the amount of code and ease of integration of C++ probably puts it over the top.

If you want to learn how to write an engine, and are a new developer I'd probably recommend C#/XNA. You'll get to the game 'stuff' faster, with less headache of learning the ins and outs of C++.

If you want a job in the industry then you need to figure out what kind of job you want. A high-level language can help get a foot in the door dealing with tools and/or web development, which can lead to opportunities on actual game work. Even knowledge of scripting languages can help if you want to go for more of the game designer/scripter position. Chances are that you will not get a job working on core engine stuff immediately, as the skills required to do so are pretty high. Strong C++ development skills are always helpful, especially in real-time or networked scenarios.

AAA game engine development involves some serious brain-twisting code.

If you want to start a professional development house then you probably aren't reading this, but already know that C++ is probably the only viable answer.

If you want to do casual game development then you should probably consider Flash or a similar technology.


If you want to be employed professionally as a game developer you need to know C/C++. End of story!


I believe that C++ is the language that you are looking for. The majority of game development is in C++ because it is a multi-paradigm language (OOP, meta-programming, etc.) and because it allows memory management. What makes C++ even better is that it can be used to develop on a multitude of platforms whereas C# cannot do so on such a big scale.

Many will say that with C# you will not have to worry about memory allocation and this is true at a certain price. You will have the burden of the .NET framework on your shoulders and will slowly see the limitations of C# in the way certain tasks must be done.

Probably you have read from some answers that C++ is a hard programming language. This is mostly true, but perhaps you haven't heard about C++0x. Some features found in C# such as garbage collection will become available (optional for you to use) with C++0x. Also, multi-threading will finally be supported by the language with this revision of the C++ standard.

I would recommend that you buy a few C++ books as well as C++ DirectX/OpenGL books.


C++.

It is the gold standard for AAA game programming. If you need to do something interesting, you will need to do C++ or delve into unmanaged C#(not always nice).

C++ is also arguably faster(usual caveats apply).

As a learning experience, C# is not worth it. C++ is unquestionably better, especially in the quasi-embedded world of consoles. To get the object-oriented experience, go towards Java.