The good old "which one"; choosing a language.

Started by
18 comments, last by daedalus316 12 years, 3 months ago
Let me jump in on this. When I first started progamming we used punch cards. Yeah, dropping them ruined your day, well, more like days. Thne I moved on to Assembly, boy life was great, I could do in hours what took days. Then I moved to C, wow what a step up that was, then C++. (Now there was some others in the mix, but not really needed for the point). Then came along C#. So what do I use? Well for 90% of what I do it is C#, not because it is the "best" lanaguage ever, but because I can get from point A to point Q in the quickest amount of time while fullfilling the requirments that I need to get done. I still use C++, C, and Assembly for other things but C# gets the job done most of the time.

The trick is to use the right tool for the job. If you just want to put out a game, use the one that gets the game out the quickest with the least errors. If you want to dig into the guts, find the tool that works for that.

There is no "best" language, only "best" languages for the job, and even that is questionable depending the person doing the job.
Advertisement
I'm pretty sure Little Fighter was a QBasic game.

Also if you're asking which language to learn you're probably missing the point. Learn how to program, learn different programming paradigms -- but not a specific language per se, outside of what you need to learn the broader concepts.
C++ is a bad language for beginners. You'll be stuck between trying to learn C++ and trying to learn to program (which are two different things!). It's a lot easier to learn C++ once you have a solid grasp on the fundamental concepts of programming (which you can learn in pretty much any language).

A (simple) example, spot the bug in this C++ program (you can even compile it and run it, and it may work, it may not):

#include <iostream>
#include <string>

int main()
{
std::string str = "Hello!"; // Create the string
const char* hello = str.c_str(); // Save the data in the string before we change it so we can use it later

str = "How are you this wonderful day?"; // Now change the string and ask a question

std::cout << hello << "\n" << str; // Print the strings out to the console
}


Now in a real application with thousands of lines of code, spotting a bug like this is a nightmare.

Besides, in real life, a programmer will know several languages. Just because you don't start off by learning C, C++, and Assembly doesn't mean you won't ever learn them. Go ahead, make games in C++. But make them in C++ later. Make games right now in a more beginner-friendly language (C++ will eat you alive; it eats everyone). We're just trying to help you avoid a lot of unnecessary pain (there's always some necessary pain, however). Seeing as you aren't even sure where to begin with learning how to program, it would be cruel and unusual punishment to push you to try and solve cryptic compiler errors, linking nightmares, undefined behavior problems, etc. from the very beginning. You'll be able to deal with these problems much more effectively once you have a grasp on the fundamental concepts of programming.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
I'm not exactly an experienced programming veteran, but I've faced the same decisions. First of all, I don't think choosing a language matters much at all. Once you know one, you can easily learn others if you put the effort in to it. I think that if you start with C#, you will learn the concepts faster, and if you want, you can try out C++. If you do that, you might even learn some C# and C++ in the time that you would have just been working on C++. Most experienced programmers know many languages. There is no "best" programming language, just languages that tend to work better in certain situations

Also, I used to have the same ideas on using game engines built by others. You have to understand that to do well in this industry, you have to work with others. Most of the time, you can't do absolutely everything by yourself. Also, the people who play your games don't care about all the behind the scenes stuff that doesn't affect their experience-what game engine you use, libraries, etc. "If you wish to make apple pie from scratch, you must first invent the universe." - Carl Sagan

One more thing to address is that if you choose to go the C# route, don't be afraid of XNA. It's a good framework, and would be your best option. Just because one game uses it, that doesn't mean that your game would be similar in any way. Heck, you can even do 3D stuff with it. It handles all the boring stuff that you probably won't want to program anyways.
Here's my 2 cents. If you have no experience programming, get some. Fast. There's no way you can do much of any game development if you don't have a mastery of basic programming skills (and math). Couple of options you might want to check out. GameMaker, which gives you a great environment to learn the basics of game development, with limited programming skills will help you gather some experience in the game development techniques and give you some programming intro. The other is Micosoft's Kudo (I think that is the name) which also will provide an intro into game development as well as some basic programming skills.

Take an introductory programming class (if you haven't already). C++, C# are just 2 languages that can be used in game programming. There's also Java, Python, Visual Basic, which all have lots of books out there already written for various levels of game development and programming. Any programming language experience can be parlayed into another programming language, so don't limit yourself to the misconception that there can be only 1.

And finally, if you haven't already, check out local schools (especially community colleges in the US) for introductory game development courses. Some are offered on-line as well as in a classroom environment. Some do not require much or any programming experience, and they can give you more basic knowledge in the process so that you can make informed decisions about game engines, or language choices. Some are inexpensive, some are not, but do check them out.

[quote name='Pingying' timestamp='1326591223' post='4902829']
I don't wanna be stuck with terraria-like games if I learn XNA


While I havent played Terraria, XNA is one of the most widely used engines available and game quality is almost always a result from the programmer and people working on the game, not the engines. There is some quality stuff from Indies on the Xbox Live Arcade, and that is all made in XNA... (quote shortened for length)
[/quote]

You mean XNA is a useful framework (I'd even accept library here) not an engine. And you mean Xbox Live Indie Games, not Arcade. Now that pet peeves are out of the way...


I would first recommend you learn C++ or C#, and use a simple-ish game engine like SFML or XNA, just to get a tast for programming, and then use either of those until you hit a limit with an unsupported feature etc, and then move on to your own engine if you need it. Just get some code examples for GL or DirectX just to see what youre getting into with your own engine.


I do recommend XNA, and SFML if you're just playing with it (not that it is bad, but it is a C++ library (not engine) that handles most of what you need, but many tutorials for it online were written as short one-offs, and as such teach very bad habits (see Global Variables, among others).


Edit:
Regarding tutorials, as programming is text based, most tutorials are in text form... (shortened for point)


No offense, but I don't see any sort of thought behind this statement. That, and it isn't 100% true, see LabVIEW (which is what we use in the engineering courses here at VT, alongside MATLAB)


Let me jump in on this. When I first started progamming we used punch cards. Yeah, dropping them ruined your day, well, more like days. Thne I moved on to Assembly, boy life was great, I could do in hours what took days. Then I moved to C, wow what a step up that was, then C++. (Now there was some others in the mix, but not really needed for the point). Then came along C#. So what do I use? Well for 90% of what I do it is C#, not because it is the "best" lanaguage ever, but because I can get from point A to point Q in the quickest amount of time while fullfilling the requirments that I need to get done. I still use C++, C, and Assembly for other things but C# gets the job done most of the time.

The trick is to use the right tool for the job. If you just want to put out a game, use the one that gets the game out the quickest with the least errors. If you want to dig into the guts, find the tool that works for that.

There is no "best" language, only "best" languages for the job, and even that is questionable depending the person doing the job.


I always love hearing stories like these. It reminds me that not all businesses are evil and have their workers forced to use legecy code, unlike one of the places I've interned at, which used C83 with macros up the ash tray and lots of legecy embedded asm. There was a bug, and their custom compiler for their embedded system detected a bug, but no more information than "COMPILER ASSERT FAIL OVERFLOW DATA CORRUPT". Worse, summer, ever.

my objective is "I want to make games. I don't care if its my own game, or work for some company". I guessed C++ would be the best because all the games I've seen so far (both indie and company ones) are made in C++.

C++ will absolutely allow you to do what you want to do, and if you've got your mind set on C++ then you should go with that choice and get stuck in to learning the basics. As you've probably realised by now, C++ is not what the overwhelming majority of our community would recommend though, but you are free to ignore that and get started learning C++ -- it's capable of doing what you want to do, it isn't impossible to learn (although as mentioned, many find it more difficult than other choices), and you'll find plenty of people that are able to help you out when you get stuck. There are also very good tools available.

A few people have already said that your choice of language doesn't really matter all that much; the important thing is learning to solve problems and express them as programs in whatever language you have chosen, sticking with it through difficulties, and dealing with complications as they arise. If you really want to use C++, make that decision, ignore the nay-sayers, and get started!


That being said, I'm just going to repeat again that you would probably be better off with a language such as C#; just because C++ is good for experienced and professional developers doesn't mean it's a good choice for you -- those people who chose to make their games in C++:

  • probably already knew how to program in C++, they weren't starting from scratch like you.
  • may have had existing libraries of C++ code to work with.
  • may have been working quite some time ago (your example of Liero is a very old game) when there weren't so many choices available and we would have all been suggesting C++ as a better choice rather than C or assembly.

Languages other than C++ are capable of very impressive results, and if you've seen anything un-impressive created with them you can almost certainly blame a lack of experience from the programmer(s), poorer quality art-work, etc. rather than the programming language that was used -- there are plenty of horribly un-impressive programs created with C++ as well.



Lastly, as you mentioned your choice of C++ was based mostly on it being used for all of the games you were familiar with, I'll provide some counter-examples of games written in other languages, which might help to show that C++ isn't the only choice.

Starting with a couple of your own examples:

  • The newer, and currently more widely available version of Liero is written in C++, but the original (which lacks a few newer features such as online multi-play but is otherwise just as impressive a feat of programming) was actually written in Pascal.
  • Minecraft is written in Java.
  • Little Fighter is written in C, not C++. Little Fighter 2 is however written in C++.

and then adding a few of my own...

  • Jak and Daxter was written in a special version of LISP.
  • Disney's MMORPG "Toontown Online" is written in Python (although the underlying engine is a mix of Python and C++).
  • EVE Online is mostly written in Stackless Python.


...and putting aside programming languages for a moment, we'll take a quick look at using an engine, as you've argued against using an engine based on the idea that you may be limited by the engines capabilities -- I'm strongly in favour of using existing engines or libraries where appropriate, and while you are to a certain extent correct that using an engine or library can sometimes impose limitations, you're probably have a worse idea of the situation than actually exists; as long as you choose an appropriate engine there's no reason you'll run into limitations. A few commercial titles that use existing engines include:

  • You mentioned the Call of Duty series; the first Call of Duty game was built using the id Tech 3 engine. Here's a list of some other titles which used the same engine, including Quake 3 and Return To Castle Wolfenstein amongst others. The list for id Tech 4 is less impressive but includes Doom3, Quake 4, and Prey.
  • Here's a list of games which used various versions of the Unreal Engine. There are well over 100 games listed, and a few select titles include BioShock, Gears of War, and Mass Effect -- amongst MANY others.
  • This list is games that used the Source engine, and includes Half Life 2, Left 4 Dead, and Portal.


As you can see, there are plenty of games made with languages other than C++, and whether you choose to use another language such as C# or decide to stick with C++ there's no real reason you shouldn't use an existing engine; you would be in good company with a massive number of commercial titles by doing so, and would learn a valuable skill (the ability to work with existing engines) that would be required for many positions should you ever wish to work in the industry.


I wrote this post in the hopes of convincing you to consider languages other than C++ -- C# would make an excellent choice for you, and should not be a limiting factor in what you can achieve, or should you choose to go with C++ after all to try to sway your attitude about using existing engines -- which simply gets the creation of basic functionality out of the way so you can focus on an actual game.

However, if you take nothing else away from this and still wish to use C++, I hope you choose to get started right away with whatever language you want. You could spend forever discussing the options back-and-forth, but you'll never get anywhere unless you jump right in and start doing things. We recommend C#, but use C++ if you really want to; just start using something now.


I hope that's helpful! smile.png

- Jason Astle-Adams

I believe some of the replies are a bit overboard on the whole don't start with C++. I think they are going a bit overboard with the whole C# thing honestly. You CAN start out with C++, depending how you enter the CS department at Stanford, you will in fact start out with C++ as your first language, otherwise you'll have 1 quarter of Java THEN proceed into C++. There's two wonderful books to start your on your path, the first is if you have absolutely NO Computer Science knowledge at all, in which case: Programming: Principles and Practice Using C++ written by the father of C++ himself as an entry-level, no previous experience required book using C++ as the language to teach you basic programming. It's an excellent book.

Now if you DO indeed have some minor experience and are not totally vapid, Accelerated C++ is a fantastic book that will guide you through the basics of programming in C++.

After this you'll really want to learn more about Data Structures/Algorithms, Computer Org (how the hardware works w/o the EE stuff). Next up would be Discrete Math, Calculus, Linear Algebra, and some basic Statistics, Logic, Economics, and Probability.

While you are covering those other subjects, you can start working on your first game, something REALLY basic like Tetris or Tic-tac-toe. I started with a black jack game myself (in Dos using CGA graphics). Then something more complex like Breakout, on to Pac-Man and finally a Platformer/Sidescroller game like Super Mario Brothers.

Do not worry about things like the engine you use or libraries yet, come to those forks in the road when you are actually THERE and not probably a year or more in the future.

[font=helvetica, arial, verdana, tahoma, sans-serif][color=#282828]I'm completely new like everyone making topics in this category. I'm just not sure about the language I should start to learn because for e.g, I don't wanna be stuck with terraria-like games if I learn XNA. This happens mostly because I have no idea how this area (programming) works. Neither do I know how to learn and which communities to be in.[/font]



The upper limit for what you can do with XNA is not terraria, You could make games with a visual quality that rivals games like Skyrim or other modern console titles with it (Given enough skill and time), Its really not the tools you use that determine what the game will look like.

Here is a XNA demo microsoft have made:

Edit: This is silly, i post a youtube link and the forum has to make it inline (Rather than a clickable link) and then it removes it entierly...


//in case it removes the vid




You could write a game that is identical to BF3 using Java if you wanted to, Your choice of language can potentially increase the system requirements of the final product (Allthough strictly speaking this has far more to do with the compiler/VM than the language itself) and your choice of graphics API can restrict you somewhat in terms of what hardware features you can use, XNA is essentially at the same feature level as DX9 and the xbox360).



If you want to make high quality games you should use the tools that simplify the process the most, (Unity, UDK, XNA are all good options for the PC)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
I personally feel that python is a brilliant way to get into game design and programming. It can teach you the fundamentals and lets you et things done very quickly. Also it is very readable code and is great for a beginner before jumping into C++ or another language. My suggestion woudl be to make a few basic games(pong, asteroids, tetris) in python using either pygame or pyglet, which are both great libraries.
www.worldofuniverse.wordpress.com

This topic is closed to new replies.

Advertisement