Picking a Programming Language

Oct 31, 2011

Q: My son is interesting in developing videogames, possibly as a career, and is now getting into the world of programming. We’re not sure why we would choose one programming language over another. Any tips?

A: There are many options, depending upon what his and your objectives and preferences are. Another entry, Choosing a Development Platform, provides a few higher level considerations that may be of use (some of which will be reiterated a bit here), but here’s a more ground-level overview of some popular options:

C++ – often started by learning C well first, since C++ includes all of C. This will be the most generally useful for career. There continues to be a large demand for people capable in this programming language, yet many schools are phasing it out of their programming curriculum, making people that know it well increasingly rare. The demand for C++ continues because it’s among the most powerful in terms of processing efficiency, making it the language of choice for big-company console development (XBox 360, PS3, Wii – as well as the type of PC games typically sold on CDs/DVDs in boxes). The reason why schools have been removing it from coursework is that it is not as conceptually pure as some of the slightly less processor efficient languages, such as Java. The main argument for learning C then C++ first is that because these languages involve manual control of memory management, which is a comparatively advanced concept excluded from many newer languages. Learning C/C++ makes it easier to adapt to learning other programming languages, whereas the inverse is often not true (that is, it’s easier to go from knowing C++ to learning another language than from another language to C++).

C++ Conclusion: Most Professional, Most Versatile Foundation

Java – This a language structurally quite similar to C++, though with a few significant differences like automated memory management. Java is increasingly popular within academia, since it is conceptually cleaner than C++, developed with network/internet functionality in mind, and natively cross-platform (in theory, Java is intended to work automatically across Windows/Mac/Linux, although in practice that’s often not the case). It is the most likely to be used in early/intro Computer Science classes. The argument for learning Java is that (a.) many educators see value in using it as introduction to Object-Oriented Programming concepts, and since it’s their job to understand and act upon how people learn that’s certainly worth weighing (b.) a mastery of it may help in early Computer Science classes, which can often be part of someone’s quest toward a career in game development (c.) it’s a language useful for understanding server-backend intricacies, of the sort that need to be understood by people developing Facebook-App-style games (Zynga-like FarmVille etc.). The arguments against Java as the first language are (a.) it’ll likely be covered in the intro CS classes anyway, under the assumption that many people in the class are learning it there for the first time (b.) prior experience with C++ will make learning Java quite a bit easier, in some parts largely a matter of learning differences in semantic ordering, allowing a student to focus on the concepts covered in intro CS courses instead of worrying about programming’s inherent oddness (and c.) Java has fairly limited utility in conventional videogame development, although it is the language used for some mobile game development (including Android).

Addition: I have been asked to mention that Minecraft is written in Java. This is true. I will also add, while I am at it, that RuneScape is written in Java, too. Those are the only two completed, high profile games I know of that are written in Java. (This is also an issue faced by C#, the next language covered.)

Java Conclusion: Good for School, Used for Android

C# – This is a Microsoft-specific language, but used by DirectX/XNA, which are a family of libraries that Microsoft released to simplify programming games for Windows and XBox360 Indie/Arcade channels. C# is structurally similar to Java and C++, but thanks in part to XNA, it is a bit more useful for conventional videogame development. Academia tends to largely ignore C# because it is a Microsoft/Windows-specific language, and schools strive to avoid preferring one company’s wares over another’s. Unity, a powerful game making environment available for free in indie form (see http://unity3d.com/unity/download/ ), supports the C# language for its scripting, and as Unity is increasingly seeing use by commercial and indie teams alike this is another reason to consider C#.

C# Conclusion: Great in Combination with XNA or Unity

Objective-C – Just as C++ contains all of C and builds off of it, Objective-C contains all of C++ and builds off of it. Objective-C is the language used for iOS (iPhone, iPad, iPod Touch) game development. 5+ years ago this language was not very useful to know, since it was pretty much just used to make Mac applications, although thanks to the iPhone boom it has gained significant popularity in industry for mobile development. Because it is so platform specific, I wouldn’t encourage emphasizing this one early on. If someone knows C++ they can pretty easily make the jump to Objective-C when/if needed professionally.

Obj-C Conclusion: Almost Exclusively for iOS/Mac, Not a Good First Language

ActionScript 3 – This programming language, also similar in general structure to C#/Java/C++, compiles into Adobe Flash .swf files. AS3 can be used without owning Adobe’s Flash Animation software, which I have a tutorial on here: http://gamedevlessons.com/lessons/mxmlc-tut/index.html. There are a few weird concepts at work in AS3, although a good library like Flixel ( http://flixel.org/download.html ) sidesteps many of those concepts to allow a programmer to focus on their design decisions rather than wrestling AS3 into doing what they need it to. Schools typically do not give any attention to AS3, since it’s a bit clumsy/strange in little ways compared to similar languages, but in practice its advantage is that a compiled .swf file (a Flash application/game) is really easy to get more players to try. A decent downloadable game made in C#/C++ will get maybe a few hundred people to play, whereas a decent Flash game made in AS3 can get a lot more exposure, literally thousands or more within a week just by uploading it to portals like Kongregate and NewGrounds. That difference is because playing a Flash/AS3 game does not require download, installation, configuration, or installation, and almost always runs cross-platform (Mac/Windows/Linux) without requiring any additional effort by the developer. AS3 is sometimes also used for the gameplay side of Facebook-App (Zynga-like) games, connected via network calls to a Java backend.

AS3 Conclusion: Easiest to Distribute/Share (by a long shot!)

HTML5/JavaScript – There is a widespread belief that this language combination will replace Flash/AS3, however in practice I have yet to see many/any decent games made in it. The main ‘selling point’ of the videogames I have seen implemented with HTML5/JavaScript is that someone went out of their way to use those languages to make the game, which of course the end-user doesn’t care about unless it somehow results in a superior experience. This seems quite likely to replace Flash/AS3 for making interactive websites, for a number of reasons, but maybe not so likely (at least based on contemporary evidence) to take the lead in the foreseeable future for making web games. Learning these languages, along with JQuery, and perhaps in addition to PHP for custom page generation, are incredibly valuable skills to know for website development but not especially useful at this time for conventional videogame making.

HTML5/JS Conclusion: Great for Interactive Websites, Not Yet for Real-Time Videogames

Good luck, and please feel free to send questions any time!

[Note: if I have excluded covering a language here that you would like to make a case for, I may simply be unfamiliar with it and its advantages! Please feel free to share your perspective in a comment below, preferably with a couple of links to projects completed in it so that we can see what it’s capable of.]



Learn and practice team game development with Gamkedo Club.
Membership worldwide. Professional support. Proven process.




Subscribe by e-mail to receive weekly updates with Gamkedo.Community interviews and YouTube training videos for game developers!



6 Comments

  1. croxis says:

    I’m putting in my vote for Python:

    Advantages: It seems almost universally herald as very quick to prototype for. As an interpretive language it has an interactive shell to try out ideas or to follow interactive guides/lessons. It also does not require manual compiling removing one less conceptual barrier from the student and the code. This is surprisingly useful for students new to programming, especially those in the late-elementary to early high school age bracket.

    Like java it does its own memory management. It is weakly typed (although some can see this as a disadvantage), uses more human readable syntax (ie, “and” instead of “&&” as well as a lack of {} and ; at the end of every line), and enforces good formatting through the use of whitespace. Python modules can also be written in C and C++ which serves as a great segway into more advanced concepts. It is also used throughout the industry from a major component in Civilization 4 to the Eve-Online servers.

    Downsides: Interpretive languages are slower than some of their counterparts (although the real question should be is it fast enough). It is also rarely used as the primary code in games; Eve online probably the most famous exception. It does take away some important concepts such as strong typing and memory management. These thing can be mitigated by diving into extending python with C++ modules.

    Python would probably work best as a starting language and supplemental to a resume. If a student is more interested in the game design side of an industry they can also quickly prototype and develop several samples using pygame or Panda3D in the time it would take using an engine in another language.

    • tartley says:

      Hey. I’d like to second the nomination for Python. I spent 7 years doing C and C++, and about the same doing C#, and have spent 5 years doing Python, so I think I’m qualified to compare them.

      Croxis has done a good job of describing Python, I’ll just add one or two refinements to what he said:

      For the record, Python is not weakly typed, it is strongly typed, and dynamically typed. Most people agree that strong typing is better than weak, whereas the debate about whether static or dynamic typing is “better” is furious, decades old and unrelenting. In my opinion this shows that both camps have important points on their side, and choosing a static or dynamically typed language should depend on what you want to do with it. Historically, dynamic languages have been under-represented outside of academia, and are therefore probably due more serious consideration than many people currently give them.

      Dynamic languages are slower than static languages at pure benchmark-like tests. However, this observation has several important caveats:

      Firstly, as Croxis noted, even though they are slower, they are certainly ‘fast enough’ for most purposes. It’s quite easy to write, for example, OpenGL programs in Python throwing hundreds of 3D meshes around at 60fps even on my modest 6 year old laptop:
      http://tartley.com/?p=1207

      C++ etc. will certainly do this job quicker, allowing more polygons, but it will take several times the effort to get there.

      As some examples of games that hobbyists have written in Python, see the 60-odd created for the last PyWeek (A ‘write a game in a week’ competition that happens every six months):
      http://pyweek.org/13/entries/

      As Chris notes, distributing your Python games doesn’t compare well to putting them in ActionScript or Javascript on the web. You have to go to some effort to bundle up your scripts and a stand-alone Python runtime, together with your dependencies and resources. When you’re done people will still be reticent to download-and-double-click, compared to simply going to a webpage.

      • tartley says:

        Forgot to mention: It’s really easy to write programs that are cross platform in Python, that run on Linux, Mac and Windows.

  2. Mark Ivey says:

    Note that most developers will end up learning at least a couple programming languages, so don’t feel too much pressure to pick the first one correctly. Think of it as picking the first of several. It isn’t a big deal if you can’t decide which one to start with. You’ll be able to make games in any of the languages listed here so just choose one and go for it.

    Almost all of the basic concepts will transfer between languages and there’s a surprising amount of overlap in the details as well. Once you know about loops, conditional statements, functions, objects, etc. you’ll recognize the same concepts in other languages. Learning the 2nd language is much easier because much of what you learn is the (small) differences between the new language and the language you already know.

  3. […] touched on this question briefly a couple of months ago in Picking a Programming Language, but let’s address it head-on with a bit more detail […]

  4. Zolomon says:

    Hi!

    I would like to mention that http://www.puppygames.net/revenge-of-the-titans/ was written in Java, source code is open and available at http://www.puppygames.net/downloads/RevengeOfTheTitansSource.zip for the adventurous.

Leave a comment

Comments Form
  • Your email will not be used for any purpose other than to update you in replies to your comments. Your website address will be shown as a link from your name with your comment. Your profile photo is auto-magically provided by Gravatar.

All contents Copyright ©2017 Chris DeLeon.

Site production by Ryan Burrell.