Some people have asked me what language that they should learn as they wish to become a games programmer.
At this point I should admit that I have never worked on a commercial game project so, if anyone is reading this who has more direct knowledge that myself, I would be grateful for any insights that I could add to these pages.
Most games will be written in C++ although, some may use C to try to get even more speed (at the cost of not having built in Object Oriented support).
For games, performance (speed coupled with a lot of complexity and detail), is the most important aspect. Therefore languages such as Java, C#, Basic, and Managed C++ are not used for mainstream games because they tend to run slower. This may possibly change in the future and factors like development time and the ability manage complexity may become more important. However, at the moment, there is not really a viable alternative to C++ for writing high speed games.
However, I would not recommend C++ as a first language because,
- It is much more difficult to start, you not only have to learn the language, but you have to choose and learn class libraries.
- You are much more likely to pick up bad programming habits, if you are using C++ with its legacy features and mishmash of class libraries.
- You have to do all the memory resource management yourself.
- You will probably spent more time debugging the faults caused by the factors above, when your time should be spent on learning the concepts.
If you do want to use C++ here is some information about using KDevelop
I would therefore recommend that you start by learning Java first, then move on to other languages if you need to.
C++, Java and C# are all ultimately derived from C syntax but with Object Oriented Programming. So once you know one of these languages you have most of the concepts that you need. Perhaps discovering how the implementation details differ between these languages helps understanding and will make you a better programmer?
When changing from Java to C++ you will need to take care of the following:
- You will need to choose between Managed C++, ATL, MFC and all the other class libraries available for C++. With experience of using Java you should be better placed to make this choice.
- With C++ you will need to manage the memory allocation and other resources yourself because C++ does not have garbage collection. If you don't learn to do this properly your programs will gradually use up all the memory without allowing it to be reallocated (known as memory leak) and your program will crash.
- With C++ you have to understand about pointers and be very aware of the dangers (not type safe, null pointers, etc.).
Flash Games
Other languages
Most of what I've said about Java also applies to C# (since Microsoft have just taken the ideas from Java, and changed them a bit, so they have a competitor to Java that they have control over). So C# is just as suitable for beginners provided that you only want to use Windows and that you don't mind paying for Visual Studio (I don't know if Mono is a viable option).
I would not encourage Basic as a beginners language as it encourages bad programming habits.
Other Aspects of Game development
There is another approach to this, games development teams tend to be quite big, with people specialising in different areas. So if you want to specialise in the creative aspect, rather than the programming aspect, you might want to get game generation software which would give you a set of ready build characters and scenes and some tools to allow you to create your own games.
Tutorials
Here are some tutorials to help you get started, they all do the same thing but they are written in different languages so by comparing them you can choose which is the best language for you:
There are some tutorials on external sites: