Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a 2D Game Programmer.Some programming languages which I am good at are C,Java ,C#. I also know Actionscript 2.0,3.0 and some javascript. I'm interested in learning 3D Game programming. So far from the research I have accumulated by googling and reading different game development forums and articles. I've noticed that most programmers tend to prefer C++.Also in an online game programming teaching course I noticed they prefer to teach C++ and Visual C++ as the starting course. The reason I am asking this question since I would like to know the "strength" difference of C++, C# and Java for 3d game programming.

Also include links to good 3d game programming articles for the already 2d game programmer.

P.S : IMHO , I also find C++ to be cryptic.

share|improve this question

closed as primarily opinion-based by Kromster, Josh Petrie Jul 23 '15 at 16:34

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

I also get that a lot. So asked a question in the community as to what skills a professional game programmer should have. Got some nice answers focussing on C++ as better language for developing games. check..… – GamDroid Nov 17 '10 at 10:16
@GamDroid: I am not interested in knowing what makes a professional 2d game programmer. I am interested in knowing about Visual C++ and why is it so talked about on. – Vishnu Nov 17 '10 at 10:34
Btw: Visual C++? Not just plain C++? – speeder Nov 17 '10 at 12:59
The Visual C++ editor is cool, but the language Visual C++ (that is: C++ with Win32 GUI API and stuff like that, both with MS Visual C++ or Borland C++ Builder) is pretty confusing and should not be used for games (it is too bloated, and using GDI is slower than using say, SDL, to control the window) – speeder Nov 17 '10 at 13:00
@Vish, apologies then, feel free to edit it to be more precise keeping in mind the comments thus far. If you mean Win32 programming is confusing, then say that. – Tetrad Dec 1 '10 at 6:03
up vote 30 down vote accepted

Yes, C++ is the language used most often (though some people do still use C).

There are numerous reasons for this. Sheer momentum is one - it's simply the language that has been used for years, a lot of tech already exists and people are comfortable with it, so changing is not going to happen overnight.

Then there is the issue of control. Game developers are control freaks, and we like to know everything that is going on in our code. C++ gives us that control, C# and Java (to pick on the two alternatives you mention) take control away. In many ways that might be a good thing, but game coders don't like it :)

Finally there's the simple practical issue that the SDKs for various platforms are very C++ centric. Using another language inevitably involves writing wrappers, cross-compiling down to VMs, and possibly (in the case of some console development) it's not allowed by the platform holder (they really don't like people doing JIT compiling, for a start).

share|improve this answer
In the mainstream development industry, yes. – JasonD Nov 17 '10 at 10:56
In terms of languages, C++, primarily - it's not going anywhere any time soon. I'd suggest it also wouldn't hurt to be familiar with scripting languages - Lua, Python, etc. – JasonD Nov 17 '10 at 11:05
Visual C++ is not a language, it's an IDE. – SurvivalMachine Nov 17 '10 at 11:43
Yes, though it's probably the most used IDE, so it's worth getting to know that at the same time as learning C++. – JasonD Nov 17 '10 at 11:52
@SurvivalMachine Well technically it's a dialect (there are plenty of MSVC++ extensions that don't exist in the standard) – bobobobo Nov 21 '12 at 20:02

C++ is still preferred as you can see on pretty much any publication on the topic of game development. I personally am currently using C for my diving into game development for the simple reason that the C++ code I write abuses templating features, uses RAII extensively, dynamic memory allocation and other things that you just should not do in game code from what I have seen so far.

Sticking to C forces me to be minimalistic and think about what I'm doing. It can be harder at times when you have to reimplement something the STL gives you for free, but on the upside I feel I write cleaner code and have a better time debugging that thing.

share|improve this answer
RAII is perfectly acceptable(and should be encouraged) in game code. – stonemetal Nov 18 '10 at 15:52
@stonemetal: RAII encourages delayed and therefore unpredictable resource allocation. Whether that should be encouraged or not depends on the size of your game and your target platforms (and the resource in question); on average I would not encourage it. Furthermore, RAII in C++ is most commonly used with heap allocation, because C++'s OO makes stack allocation too hard. – user744 Nov 19 '10 at 12:05
In what way does RAII encourage delayed resource allocation? When I use GLFW I make a class called GLFWRAII that calls GLFW's init function in the constructor and calls GLFW's clean up routine in the destructor. I allocate it on the stack at the beginning of main, it in no way delays anything nor does anything unpredictable. Other uses might be to allocate at the beginning of a level and clean up at the end of a level. Poorly using a technique doesn't make it a poor technique. Nothing about RAII suggest unpredictable resource allocation other than poor use. – stonemetal Nov 19 '10 at 14:38
You just have to avoid using those features. I use C++ and I never use templates in my code nor have objects throwing exceptions in their constructors. In C you can still use dynamic allocation (and you must for a 3D game). Besides, you should code in a way that also someone else find it easy to understand--a big project in pure C code can be a hell, even if you understand it. If you learn to think about what you're doing even if the language doesn't force you to, you will be able to write clean code in many other languages too. – Pablo Ariel Sep 3 '11 at 19:49

I'm personally not a fan of C++, and I prefer Java. However, most people in the industry do use it and it's the easiest language to convert to other platforms without wrappers and virtual machines.

However, sometimes other languages work out pretty good for game development. I use Java with LWJGL and it is amazing. So if you want to start with 3D programming and OpenGL without having to learn C++, try out LWJGL with Java, because it's very lightweight and I think it's actually C++ code running through JNI.

Maybe in the long run you might want to switch to C++, but you can start and practice with C# or Java. Because most game code comes from experience with the language, but you should try and practice OpenGL with a language you're comfortable with. Also, while you're practicing graphics, you should also try out GLSL with OpenGL, it has very C-like syntax

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.