Choosing a Language
When building a browsergame, there are a lot of choices to be made. Will it be turn-based or real-time? Will it have advertisements? Will I charge people to play? But one question that you need to answer early on in your development process is: what language will it be built in?
To begin with, you need to know something that’s going to drive you batty: it doesn’t matter.
As long as you have the skill, you can build a browsergame in any language you want to. People are known to have used Perl, PHP, and Ruby(on Rails) – but that doesn’t mean you have to! You could write your game in coldfusion, ASP.Net, or any language you prefer. It doesn’t matter which language you use.
With that being said, there are some caveats to that statement.
You should pick a language that has an active community – they’ll be able to help you, and you’ll be able to find answers to problems you’re having faster than if there wasn’t one. It’s hard to find good resources on how to write the code for an item-drop in fortran – but it’s pretty easy to find examples for Perl, PHP, or Ruby.
You don’t need to worry about scalability. At all. Just focus on writing clean, bugless code; once you have achieved that, it will be easy to add more scaling and optimization later if you need to. Premature optimization is a waste of your time – the things you’ll notice and tweak during development won’t be the things that actually appear during deployment. And your language choice won’t affect how scalable your game is anyway – only your skill will.
With that being said, it’s sort of hard to choose a language – if there are no ‘real’ gains to be made by using any one language, why should you choose one over another?
There are a few reasons for why one language might be better than another – although all of them have to do with your situation.
How easy is the language(for you) to learn? Does it have helpful screencasts or anything available, or good reference materials? These will be key to learning the language well. You’re better off choosing a language that you can learn in a month and build your game with, than spend 2 years learning it and 3 months building your game – although there’s no one saying you can’t learn the language and work on your game at the same time.
What’s available for documentation? Perl has perldoc.perl.org, and PHP has php.net – what does the language you’re thining of have? If there’s no documentation available, you’ll have a horrible time trying to track down bugs and learn the language.
What does the language have available in terms of libraries and bonuses? Ruby has Rails, which is pretty popular right now. Perl has CGI::Application and a whole bunch of other frameworks, and PHP has cakePHP. But all the languages have multiple frameworks available – this shouldn’t be the only factor you use to choose the language for your game. If you don’t like any of the frameworks, you can always switch to another one.
What platforms will the language run on? You won’t be able to use ASP.Net on a linux machine, unless you have the mono framework – which most commercial webhosts are unwilling to install for you right now. You should check to make sure that whatever webhost you chose has support for the language that you choose.
These are all factors that are involved in choosing the programming language that you will build your game in. If you already know a programming language, you’re best using that – you’ll get code written faster, and you’ll write better code overall because you’re more experienced with it. But really, the choice is up to you. No one will punish you for writing your game in one language instead of another, and there is no ‘right’ or ‘wrong’ choice. There’s just what you feel happy with, and what lets you get stuff done.
Wish there was more?
I’m considering writing an ebook – click here.