Programming language decisions

Hello citizens of JGO!

I know it might be a rather odd question on a Java Gaming Forum, but please bear with me.

I’m in the process of trying to decide which language to use to create games. The candidates are Java, C++ and C#. Why these? Well…

To me, Java is an all-rounder, a WORA (Write Once Run Anywhere) type of language, which makes you, the programmer, able to write a single source code and just take it to windows, linux, osx, android, iphone, and so on.

To me, C++ is the standard when it comes to programming. Even though my knowledge in C++ is the worst of the three mentioned.

To me, C# is a mix of Java and C++, bringing best of both worlds together. However, you can only write code on Windows, which is kind of a let down.

What pros / cons can you list to these? Why would you use them or not use them? Bear in mind, my goal is to build a game (finally start to build one, at least), and more often than not do that on a linux. (I know, this sort of rules out C#, but I would use windows only for that…)


C++ is most demanding and you have least knowledge of it. So that rule it out.

Many have said that C# bindings to openGL is 20% slower than Java have(lwjgl/jogl) but maybe that does not matter much.

So it’s about flawor more than anything else. If you want use Unity then C# have some edge but otherwise I would prefer Java becouse of tools.

  • Performance doesn’t matter. If anything, the (marginally?) better performance of C++ just allows you to get away with worse code and algorithms. I once had a C++ teacher who told me that a slow O(n^2) sorting algorithm was okay in C++ because the language was so fast. He was an idiot.
  • In my opinion C++ is too low-level for games. Any decently programmed (advanced 3D) game should be GPU-limited anyway, and you can use the exact same graphics library from all 3 languages (OpenGL). In C++ you end up doing lots of non-gamey stuff like memory management, e.t.c and have a harder time debugging pointers e.t.c. Also, C++ coders all have broken Caps Lock buttons.
  • Can’t say much about C# other than that it only runs on Windows. There’s no argument for it, but also not much argument against it. Well, XNA is having development problems if I remember correctly, but I don’t follow those news very closely…

In the end, I’d say Java. I wouldn’t be on this forum if I didn’t say Java, but in the end the language you choose matters very little to how you improve as a programmer (assuming that is your goal).

I go with theagentd xD I mean… Of course most of us will say Java. Go to a C++ Forum and most people will say c++ of course (can’t understand those people, but whatever [even a friend which is highly skilled in c++, says that he hates the language xD])

Java doesn’t go to the iPhone, infact it doesn’t go anywhere apart from the desktop without issues - and even there it can be a bit irritating.

C++ isn’t really the standard. C is the standard. If you check out the programming language statistics ( you’ll see Java is actually the most used and most “standard”.

C# goes to XBox which is a big win. With Mono it goes to Linux, OSX and iPhone. It’s a good language but will always be trying to be Java. Which it’s not.

On this forum you’re generally get told to use Java. However, there isn’t really a massive difference between them all. Pick one you like and focus on writing the games.



I can only tell you my reasons for choosing Java.

I have the most skills and experience in java - biggest factor
C++ is quite old, full of shit and convoluted to say the least
C# is a microsoft standard - I might as well program games that only work on microsoft silverlight

also java games work without as much effort on at least 3 platforms

and performance, well, Server JVM is, once started, in many cases faster than C++

XNA is interesting, because its the easiest way of getting your game to a console - but I would only go so far as to port it, not write it exclusively for it

the only reason C++ is still so big, is that old established standards die slowly, just like Windows

Thanks for all of your views!

Don’t get me wrong, I knew that many (if not all) of you will reccommend java, but you took the time and explained your thoughts on all the three languages I asked you about, which is a great help in itself.

It helps me, someone who doesn’t fully understand either of them to get some info from experienced programmers and root out the misinformations I might have about them.

I think I will stay with java. The amount of (unreadable) code it takes to just create a window with C++ is making me want to never sit in front of a computer ever again, and C# is too constricted (to Windows, xbox and windows phone) for my taste.

This goes out to all of you.

At the start, for your first game. I would stick with what you know best. You will get more done faster and not be bogged down with learning new details. Your biggest enemy is not finishing anyway.

Awww my hand was bigger than that hand! :’(

Java all the way. I’m using C# at school and it sucks. The API is pathetic and XNA sucks. The only good thing about it is the “properties” syntax and the option to pass by reference.

The tools are free for them all so download them and have a play with each one. Don’t get caught in the trap of being a one language guy / language evangelist. There’s good and bad in all of them no matter what anybody tells you.

As per Kev’s reply, the days of C# being Windows only are long gone. And XNA, most definitely, doesn’t suck.

There’s also game maker applications / frameworks (GameMaker, Unity, etc) that may be a better option if you just want to get games finished.

What sort of stuff do you want to write and what devices do you want to target? Answering that may help you decide which option to go for - at least initially anyway.

Oh, and Hi - first post :slight_smile:

Hi Paul :smiley: I wondered when you were going to turn up!

Paul is being assimilated into Puppygames, though he doesn’t realise it yet. Resistance is futile!

Cas :slight_smile:


I’m not resisting very hard though am I!

Mono .NET implementation differs from Microsoft .NET implementation. Mono is reliable but don’t expect something comparable with Java, look at this:

@pitbuller you’re too kind with OpenTk and Tao Framework, their performances are even worse than that ;D

The best compromise is Java except if you really want to use ios. Has someone tested in-the-box and ispectrum open?

“Posted by Patrick Smacchia on January 19, 2009”. Used an older version of Mono too.

There’s also the MoMA tool:

In Java land, I’ve had a few folks recommend Slick as a decent framework.

C# is also the basic language for Unity is it not?

My 2p on the whole matter:

Java: great - really great - for desktop development, and Android development too. There’s precious little money in Android though, and desktop money is extraordinarily hard to come by. Android performance lame.
C#: great for XBox tinkering (only tinkering though - XBLIG is basically a cesspit of dross and zero marketing effort, and your chances or making money here are next-to-zero). XNA was good once upon a time but according to various sources is now not-so-good and anyway really only achieves what various other frameworks achieve, no great shakes. Performance often severely lacking compared to Java. C# on Mono stretches deployment to various other targets but again performance is lame.
C++: run anywhere at high speed, with a reasonable amount of hair loss. Rest assured you can do it, but it takes a fair bit longer to get stuff working.

Cas :slight_smile:

C#, Boo, Javascript - core engine is C++ I believe.

Well, you’ve constantly proved that you can write great games using Java :slight_smile:

Agree 100% - Microsoft really, really dropped the ball with Xbox Live Indie Games. Use for fun / hobby projects. Still, it’s awesome to see your games running on your Xbox. Big smiles there. And you never know, you could get lucky (Fortress Craft or the Dishwasher guy). Only way for most devs to write code for it though unless you miraculously manage to get on XBLA (although would you really want to do XBLA certification shudder)

XNA 4.0 is brill - they did a great job of tidying up all the crud. Not sure why people think they broke it - Well, actually I do. Most folks don’t realise there are 2 profiles in XNA; Reach and HiDef. And as Reach is the default they assume all the fancy shadery goodness has been nerfed so they could target the Phone. They didn’t. They made the reach profile robust enough to hit a wide range of hardware and fix up all various driver problems.

Desktop deployment is sucky though.

But Java isn’t available on the Xbox so no worthwhile comparison can be made. It’s the cheap ass Compact Framework they used that is the reason for 95% of the performance problems. If they have built a framework specifically for the console it would fly. And the in order CPUs don’t like the branch heavy code the CF jitter produces.

C++11 may take away a lot of the ‘pain’ of traditional C++ but having not used I couldn’t really comment.

I am watching C++11 with great interest.

Could it really be the case they’ve made C++… good?

Cas :slight_smile:

As long as source code is separated in header and source files it simply can’t be good ;D

No, they’ve made a kracken by nailing legs to an octopus.

More seriously, no because they’ve failed to address any of the core problems that make it such a pain to work with. Largely because they’re sticking with being backwards compatible so they’ve still got a very hairy and hard to parse syntax that’s ambiguous unless you take the whole program into account. And then they’ve bolted on a bunch of extra syntax and overloaded existing keywords so they do completely different things based on new context.

The compile model will still be the same, so compile times will still suck. Unless you’re really careful with how you structure all of your code, your compile times will still really suck.

The additions to the standard library are much better, but then that’s because they’re all really basic things that either should have been in in the first place (smart pointers) or should have been added ages ago (threading). And by now everyone has already rolled their own or uses Boost.

Oh, and it’ll take a couple of years before gcc and MS have actually implemented it properly, and a few years after that that we can actually call it widespread enough to be actually used and drop support for pre-C++0x compilers.

So frankly I don’t think it’s going to set the world on fire.

Again, I thank you all for your comments. I have one more question to ask you, just to derail a little;

Is there something in java that you personally don’t like, or hate, for that matter? Something I should be vary of, invest learning in the beginning, and so on?

edit: or avoid completely?