The Language of Game Development

Shamus Young

New member
Jul 7, 2008
3,247
0
0
The Language of Game Development

If you are getting into game development, what programming language should you choose? Shamus tackles the question.

Read Full Article
 

TiberiusEsuriens

New member
Jun 24, 2010
834
0
0
A big problem with a lot of people in the software engineering industry is that they tunnel vision. All too often people dedicate their entire work lives to learning "that one language which they will use forever." However, the industry evolves and the desired languages change more often than most want to admit.

If you want to get into software (be it gaming, financial, or any other field) the most import thing you can do is learn concepts, not languages. Once you've 'learned' one language, you can pick up most others because they all share concepts. Just like games, languages are typically built off of each other. It can be more beneficial just to pick a language that approaches the most programming concepts and practices.

Would rather know how to expertly craft a screw or a nail, or would you rather know what screws, nails, timbers, and shingles are and how to combine them to make a house?
 

Hagi

New member
Apr 10, 2011
2,741
0
0
Personally enjoy Ruby when it comes to higher-level languages. It's got a nice standard library, a great gem system that allows for extremely easy usage of other people's code so you don't have to reinvent the wheel for the nth time and it's widely used for web development which I find to be one of the most fun entry-points into programming.

Also another good article related to the question, as to why scientists generally use a language even somewhat harder to learn than C:

http://arstechnica.com/information-technology/2014/05/ask-ars-why-are-some-programming-languages-faster-than-others/
 

Riverwolf

New member
Dec 25, 2013
98
0
0
I would also very much recommend Python (or Ruby) as a great place to start learning instead of C++, largely because C++ is the language I started with, and it took me FOUR YEARS to get to any point where I could start programming Tic Tac Toe using a variety of paradigms. Python could have gotten me there in under a year, and I might already have a game or two on the market. (Don't bother with BASIC. Python and other such languages have long since overtaken BASIC as good "beginner's all-purpose symbolic instruction code.")

But I also could not stress and second enough the fact that we're all regular people, as well, and regular people are very capable of learning to program. Steve Jobs once said that he believed every person "in [the US]" should learn how to program a computer. I absolutely agree with him on that statement, and go further by saying everyone in every country where computers and internet are readily accessible to the masses should learn to do that. I'm not terribly great at math; I still have real trouble with 5th-grade long-division or by-hand multiplication that doesn't involve sectioned boxes. I wasn't into computer technology growing up. I'm not the kind of hacker you think of when the idea of "computer programmer" comes to mind.

But I still did it. Four years and still having trouble with the syntax of polymorphism and STL containers in an object-oriented paradigm, but I still did it. Anyone can do it given enough time, practice, and dedication. I'd say for anyone who wants to be a programmer but doesn't feel like one, think of it as a computer-based martial art. You just go to a class 1 hour a week, and spend an hour or so every day practicing. That can fit well within a standard work/school schedule, and the great thing about programming is that the "class" can just be research online, youtube tutorials, source code reading, etc.

And I would highly recommend checking out some source code. ID has released its games as open-source, so check out Wolfenstein 3D and Doom. Both were written in C/C++. The source code for the original Metroid is also available (programmed in 6502 Assembly, the native language of the NES, 2600, Commodore 64, and other machines from the 80s), so if you want to see what NES programs looked like, check it out. A note on reading source code too important to be footed: you don't have to read it all the way through; just open one of the files (there should be multiple files) and see if you can figure out exactly what the programmer was thinking. You can do it.

TiberiusEsuriens said:
...

Would rather know how to expertly craft a screw or a nail, or would you rather know what screws, nails, timbers, and shingles are and how to combine them to make a house?
Very well said.
 

rofltehcat

New member
Jul 24, 2009
635
0
0
Depress gas pedal 10%. Turn wheel 10° to the right. Traverse 5 meters. Turn wheel 10° to the left. Depress gas pedal 15%. Traverse 100 meters. Release gas pedal. Depress brake pedal 25%.
That sounds exactly like what I'm currently doing in Matlab (unrelated to game development, of course). I guess at least I don't have to worry about memory management (as long as I don't do stupid stuff like increase matrix size every loop).


What we were told by computer scientists in our very limited course for engineers (they taught us Java...) learning one language really well and limiting yourself to it is the wrong way to go. Understanding the basics and then being able to quickly pick up a new language is supposed to be better but would your boss leave you enough time to learn it (and some time from colleagues to help you with that)? Or would he instead just hire the other guy who placed his bets on the right horse?

I think it was already discussed on one of the Diecast podcasts hosted on Shamus's site. But still, what about "game development" (or comparable) majors/masters programs? If I remember correctly, going the route of computer science (or arts/management) route instead (and doing some game development on the side) was seen as a better choice (because it can earn you money outside of game development,too). Now, I agree with that but I just found it strange that the topic of majors choice was brought up in the article but game development majors/colleges/whatever weren't mentioned.
 

lacktheknack

Je suis joined jewels.
Jan 19, 2009
19,316
0
0
rofltehcat said:
I guess at least I don't have to worry about memory management (as long as I don't do stupid stuff like increase matrix size every loop).
Be glad. At an old workplace, a multiple-day corporate disaster that nearly lost clients was traced back to one single misplaced memory allocation error.

Programming: Scary, but fun. :D
 

Lemmibl

New member
Jan 27, 2009
58
0
0
I learned programming with C++. Well, it was more like C with classes, because my teacher(s) were clueless/shitty old basement coders. Think it took me about 5-6 years before I built up enough experience, knowledge and confidence to make my own (shitty) game engine in C++ with DirectX 11.

It has been said a thousand times before -- and I still believe it to be true -- that if you have learned and are at least proficient with C++, it's a lot easier to pick up on higher level languages. I think that would be the ONLY benefit to start with C++. Would still never recommend it.

I'm still sort of torn on the whole thing. So C++ really isn't beginner friendly. It's becoming more so, though, with the direction the language is going. C++11 did wonders to make it an easier language to work with (auto, ranged for loops, lambdas, std::thread), and it seems like it's going to be continuing in that direction, at least it seems that way when reading what Bjarne Stroustrup is saying these days (I have no facts to back this up).
 

Tiamat666

Level 80 Legendary Postlord
Dec 4, 2007
1,012
0
0
For me, bytecode languages with just-in-time compilation like Java or C# fill the sweet-spot between speed, power and productivity. I will not bother with C or C++ because as a hobbyist game programmer there is no way I will need the kind of performance that AAA titles have to squeeze out of the processor. On the other hand, interpreted scripting languages like Python are nice, but lack the edge of compiled languages and especially the static analysis tools, as most of these scripting languages are dynamic. I think it's ill advised to write a larger framework in a dynamic scripting language. There's a reason why they are called "scripting" languages after all. They are most well suited for short scripts that are executed in a well-defined environment.
 

Griffolion

Elite Member
Aug 18, 2009
2,207
0
41
If you're wanting to get into development of any sort, then asking "which language do I pick" should not be at the top of your list.

Learning design patterns, complexity modelling, rapid prototyping, formal specifications (code contracts), high integrity development etc, should be the priority. There's a ton of theory work that needs to be done to make you into a decent software engineer. I jumped into development by just going straight into programming stuff, keyboard composing. It was only til later when I started learning best practices at university that I realised the sheer amount of bad habits I had naturally formed. It was a painful process, getting rid of them, and forming better ones. My advice is to not just jump into a language, but do the theory work that applies industry wide. A project with a well designed program (game or otherwise) looks at the code last, no matter the language, since it's the design that matters. It's great that you may have just made a game that runs a few things on different threads. But it's entirely something else to have those threads be memory safe, and created via a factory pattern.

Regardless, if you're wanting to learn a language, then C++ is always a good one. It's pretty popular, well documented, and fast since it compiles to native. It also gives a lot of freedom to learn memory management. As the creator of C++ himself said, "...with C++ it's much harder to shoot yourself in the foot [than it is to do with C], but when you do, you blow your whole leg off.".

If you're after something fast and entirely OO, then try C#. If you're wanting something more for scripting, then try Python. If you're a masochist, try Java.
 

Hutzpah Chicken

New member
Mar 13, 2012
344
0
0
Being at the start of my Computer Engineering education, I've taken the first of several C++ programming courses. I wouldn't say it is a difficult language to learn, but I learned basic XML coding from various mods to Empire at War. Any student or person who has interest in programming should not ask which language to pick but which language to start with. Once you have the general theory and conventions one can use most of the compilation languages.
 

Fordo

Senior Member
Oct 17, 2007
131
0
21
What language to learn is a weird question and yes, I'm sure people who have passion but don't know much about programming ask it a lot... I know I did.

I love your recommendation to get into some kind of modding. This is a great way to introduce important concepts like instantiation, casting and inheritance without needing a classroom, and they're much more interesting to play with on a custom map builder than staring at a bunch of code, or struggling with a homework assignment or test.

I've programmed in my education or work life in PHP, VB.net, Objective-C, Java, Javascript, and Ruby/Rails. Any of these choices could be used to build some kind of game relatively quick even if only some sort of text adventure game. I think the best choice for beginners is ease of entry.

Languages like Python and Ruby have great followings and are definitely the hip languages to learn, but I don't think you can beat the documentation and support of some other languages like iOS' Objective-C. I picked up Objective-C outside my college classes following Apple's objective-c documentation and using a lynda.com subscription to release my first app to the app store. It's got a bit of a learning curve, but once you're used to the way xCode works, programming is not near a pill it is on some systems. Plus iOS is easily one of the biggest markets to sell a game in.

If you don't have a mac or don't want to pay the Apple developer fee, I may recommend either javascript or Java depending on what your gaming vision is. Javascript is hugely popular and great for many kinds of web apps, and Java is also hugely popular and can be used for building Android apps.
 

MmmFiber

New member
Apr 19, 2009
246
0
0
Tiamat666 said:
For me, bytecode languages with just-in-time compilation like Java or C# fill the sweet-spot between speed, power and productivity. I will not bother with C or C++ because as a hobbyist game programmer there is no way I will need the kind of performance that AAA titles have to squeeze out of the processor. On the other hand, interpreted scripting languages like Python are nice, but lack the edge of compiled languages and especially the static analysis tools, as most of these scripting languages are dynamic. I think it's ill advised to write a larger framework in a dynamic scripting language. There's a reason why they are called "scripting" languages after all. They are most well suited for short scripts that are executed in a well-defined environment.
Python is a great place to start learning the basic concepts behind programming. And, C# definitely hits the sweet-spot. I've been using C# for a while now, and it is great. C# is fairly quick, easy to read, fast to write, and not old enough to have over 9000 deprecated classes/methods.
 

RA92

New member
Jan 1, 2011
3,079
0
0
There's also C#. It's got a nice, clean syntax, and has enough in commonality with C++ to move up to it with relative ease.

The most important thing if you want to learn programming, though, is to get in a problem-solving mindset. After learning the syntax and getting a basic idea on the tenants common to all languages, practice problems posted online, and check other people's solutions to see how you can make your own code more efficient. Without that mindset, not even the highest level of language will come to much use.

Programming isn't that hard to pick up; but just like any other skills, you need to put some effort into it.

Also, isn't Unreal Engine 4 ditching UnrealScript fully for C++? And CRYENGINE has always used C++ for scripting. The visual scripting languages (like Kismet) stuck on them are kinda limited. So don't think C++ is going to be irrelevant anytime soon.
 

Arnoxthe1

Elite Member
Dec 25, 2010
3,391
2
43
Tiamat666 said:
For me, bytecode languages with just-in-time compilation like Java... I will not bother with C or C++ because as a hobbyist game programmer there is no way I will need the kind of performance
You know, that's what Notch thought when he made Minecraft. 'I'm not doing anything serious. I'll just write this in Java.' And to this day, we are still paying the price for it with EXCESSIVE amounts of load on the processor and almost nothing on the graphics card.

Just saiyan. You never know what could happen. Best to learn something like C++ for anything big at all you might want to do.
 

NuclearKangaroo

New member
Feb 7, 2014
1,919
0
0
are you sure C++ is no longer widely used in game development? is one of the most popular languages around, hell the source engine was written in C++
 

Colt47

New member
Oct 31, 2012
1,065
0
0
I don't think I can completely agree with this article on where to start learning how to program, but I understand where Shamus is coming from. If someone is after the fastest method to become productive, then going with Python or Java as the first language is a good move. If someone is interested in understanding programming well enough to pick up any language they want later down the line, then C++ is a better place to start. It's basically the whole "teaching a man to fish" vs "giving the man a fish".
 

Retsam19

New member
Dec 6, 2010
60
0
0
As a programmer (though admittedly not a game programmer); I'd actually tenatively put Javascript as my top language to learn. It's got a lot of the benefits of python, that it's a language that's fairly simple, doesn't have a lot of the baggage that C++ family languages do, but it's much closer to those languages than, say, python. Also, it's literally impossible to more convenient language, right now. Press F12 (Cmd-option-J for mac users), type "alert('Hello World')", and boom, you're programming in Javascript. (And then please forget that alert exists and never type it again, but that's a tangent)

The best and worst thing about javascript really is the web. The worst is that it's easy to get mired in the parts of javascript that relate to webpages; a bunch of "Javascript tutorials" if not most, are more related to the web and webpages than the language itself. But the best is that html is one of the easiest ways to put together a decent user interface, which is one of the trickier problems in programming (creator of minecraft [https://twitter.com/notch/status/466240151761715200] tweeted earlier today roughly compared it to kissing poisonous snakes), but a critical hurdle to game programming. (Unless you're making a text adventure game)

For reference, this is an implementation of Conway's Game of Life [http://jsfiddle.net/Retsam19/m6tZr/] (despite the name, not really a game) that I put together in literally a couple hours last week.

But yeah, I'd definitely reiterate Shamus's point that obscure knowledge isn't the same thing as difficult knowledge.
 

joshuaayt

Vocal SJW
Nov 15, 2009
1,988
0
0
I can't say I agree with specifically not starting in C++- Not only does it give you the basic grounding for any of many different languages, it is very free with how you use it- you don't want classes? Want to come back to pointers later? Alright, have fun, they'll be there if and when you decide to use them.

My personal favourite benefit, though, is that there is an overwhelming amount of C++ support, due to how popular it was and mostly still is. With the sheer amount of help you can get from sources like stackoverflow, I'd put it at one of the *easiest* languages to begin with in the long run, even if actually starting out can be a bit of a hurdle. If ever you're stuck, your problem has been encountered, asked and dealt with in 100 different forums.
 

Retsam19

New member
Dec 6, 2010
60
0
0
joshuaayt said:
I can't say I agree with specifically not starting in C++- Not only does it give you the basic grounding for any of many different languages, it is very free with how you use it- you don't want classes? Want to come back to pointers later? Alright, have fun, they'll be there if and when you decide to use them.

My personal favourite benefit, though, is that there is an overwhelming amount of C++ support, due to how popular it was and mostly still is. With the sheer amount of help you can get from sources like stackoverflow, I'd put it at one of the *easiest* languages to begin with in the long run, even if actually starting out can be a bit of a hurdle. If ever you're stuck, your problem has been encountered, asked and dealt with in 100 different forums.
It seems like everything you say equally applies to almost every mainstream programming language. You can program all of your Java code in one massive class just as easily as you can with you C++ code. And I can pretty much guarantee, you're not going to struggle with finding help from sources like StackOverflow for any mainstream language. Besides if you want to talk about "sheer amount of help", C++ is currently 8th on the list of most used Stack Overflow tags, behind (in order) C#, Java, Javascript, PHP, Android, JQuery, and Python. C#, Java, and Javascript all have over double the tags that C++ has.