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!

All contents Copyright ©2017 Chris DeLeon.

Site production by Ryan Burrell.