Picking a Language

From GPWiki

Contents

Foreword

For those who choose to begin programming, selecting a first language can seem like an insurmountable task. There are tons of languages out there—which one is the best?

There is no best. Languages have strengths and weaknesses, problem domains for which they are suited, and problem domains for which they are not. As a beginner your problem domain is learning to program—not speed, portability, popularity, or anything else—so it makes sense to choose a language that is conducive to learning. As a programmer you will not need to stick with a single language for the rest of your life, so it's no big deal if your first language isn't very good at some things. In order to be a good programmer you will need to learn many languages over the years, and learn to use the right tool for each job.

Readers should also be aware that programming languages come and go. Programming languages are recommended due to their current relevance to this particular industry sector. In future, this article may recommend other languages -- or maybe something else entirely! For example, today, C++ sees a lot of use in the mainstream games industry. However, it was rarely used ten years ago, when its ancestor, C, was in the ascendant. Twenty years ago, almost all games were written directly in assembly language -- the closest thing we have to the native language of the computer's CPU.

Software development is forever evolving. There will always be new tools to master.

So which languages are good for learning?

Two commonly recommended languages for beginners are Python and C#. They are some of the easiest languages to learn, and they help beginners learn better programming practices, which will be useful if they move to other, more complex programming languages later on.

There is an excellent Beginner's Guide for Python available through the official site, which includes instructions on how to set it up and begin programming.

A free Integrated Development Environment (IDE) is available for C# from Microsoft, MSVC# 2008 Express. There is also a workshop available on GameDev.net's forums. It has since finished, but all the material is still available to learn from.

See the Resources section for more info.

I've set up an environment, now what?

Start small. Work through the various guides available for beginners and learn the basics of the language. Write simple text-based games like Guess the Number or a Text Adventure, and work your way up as you become more proficient with the language. It's a good idea to work on simple non-game projects too—anything that will help you gain more experience. At this level the most important thing is to become familiar with the language itself, not necessarily to program games. Many games will require more skills and knowledge than you currently possess, so learn the basics well and form a strong foundation for future endeavors.

Once you're capable and know your way around the language, you might want to move onto simple graphical games like Tic-Tac-Toe, Pong, or Tetris. From here you can work on anything you're interested in, just be realistic about what you can accomplish, and apply experience gained from past mistakes to produce better code.

Keep in mind that game programming is just like any other kind of programming. Games are not necessarily more sophisticated or complex than other applications and share many of the same design problems. The skills you learn from writing a word processor will transfer to games, so the important part here is just to gain programming experience, not necessarily game programming experience.

There is no quick and easy way to become a great programmer ; it takes time and effort, and only experience will enable you to accurately assess and solve problems.

Wait, what about C++?

This issue comes up frequently. There are plenty of reasons to use C++, but it's not a particularly good language for beginners for a number of reasons. Many argue that you should start with C first, but you may start in whatever language you want. There are many programmers who have used C++ as their first language, but for some people; it may be too complex. .

  • C++ often has you fumbling around with its syntax and quirks (i.e. the language) rather than letting you just focus on the programming.
  • As a beginner, you want to develop programming skills, and the easiest way to do that is with a language that's easy to pick up.
  • While C++ is one of the most widely used languages in the industry, this is primarily because of historical reasons. Video game studios have large proprietary code bases, and they employ many programmers used to programming in C++. Rewriting code in another language can take large amounts of time and money, so the companies continue to use C++.

The game industry is beginning to use other languages besides C++. For example, EVE Online and Civilization IV use Python extensively, and C# is popular within the industry for writing tools (ArenaNet uses it for tools for Guild Wars, among others). Java is also becoming a little bit popular, it's syntax is alike C++.

Resources

Below is a list of resources that will help you get started.

  • GameDev.net - A website with a large community devoted to all areas of the game industry.

Python

C#