Main image of article Best Practices in Web Game Development
I've been developing websites and games for about 11 years. I started first with (Don't laugh!) Microsoft FrontPage, which was ok for a year or two, then moved on to Visual C# and Macromedia (then later Adobe) Dreamweaver. Along the way I've picked up some best practices that you might find useful. Feel free to ignore them; I sometimes do! Many of these practices apply to normal programming as well.

Use a Version Control System

These have been available for the last fifteen years or so, starting with the likes of Microsoft Source Safe and CVS, then Subversion, and more recently distributed VCS, such as Git, Mercurial, and Bazaar. A VCS is a repository for all the source code and assets (graphics, sound files, etc.) in a project. Not only does it keep the files safe but it tracks all changes and lets you revert to earlier versions, or view the differences between different versions of a file. Every team should use them, from one developer upwards. For years I managed without using one, but I can remember the times when I lost files, or had to work out which was the most recent, with multiple copies, conflicting versions of files, and sometimes mixing up files and losing recent work. A VCS helps manage changes, so would avoid all these problems that should never have happened in the first place. Most of the popular VCS are open source so cost is not an excuse to avoid using one. Teams that aren't in one location should use a distributed VCS to let team members keep code in sync with each other. VCS aren't just for programmer's files. They work well with text files and some (e.g. TortoiseSVN, the Windows user interface for the open source Subversion) can handle Word files so writers should get into the habit of using them. The open source WinMerge utility has plugins for comparing Excel and Word files (not with each other!).

Use an Automated Offsite Backup

This is for anyone who has had that sinking feeling and sense of increasing desperation when they've discovered that the only copy of a really important file is either corrupted or missing. Once you've experienced that, you'll appreciate the value of an automated backup system. You can roll your own or make use of a commercial service like Mozy.com or carbonite.com. You specify which files to backup, and the backup runs in the background and uploads changes when your computer isn't busy. Go have a coffee and the morning's file edits will be all safely backed up when you return. The first time you do this it will take a few days to upload, if you have a few gigabytes of files selected. But after the first time, you'll never notice it. Before I used this, I once came really close to losing six years of digital photos that I'd backed up to an external hard drive. Thankfully, a disk recovery service only charged me £250 to recover my photos from that hard drive, which had a burnt out motor. Since then, I'm happy to pay about $1 a week for offsite backup. No burglary, fire, or other calamity is going to cause me to lose my work. Also, if you have a team or multiple computers, dropbox is just wonderful for syncing files between computers and even the 2GB free version includes 30 days of file version history. I use it on Windows, Mac, and Linux desktops and my iPhone. It's by far the easiest way to transfer files.

Use a Single File Wiki for Design

I use a single file Wiki for not just writing designs but for holding information, contacts, etc., in a free form searchable file. For years I'd been using Wiki on a Stick, which has served me very well. Recently though, I've been trying out TiddlyWiki as Wiki on a Stick has had a few problems in recent versions. If you try either of these out, use the FireFox browser, as other browsers have security issues. Also on Windows Vista/7, you need to change the security settings to give everyone full access. Recent versions of browsers have tightened up security on file access, and browser loaded files that rewrite themselves are usually blocked by default! Once you've got past that though, they can be incredibly useful. At work, I track all links, work projects, tips, etc. In four years, it has grown to more than 500 pages long and is still less than 1 MB in size.

Which Audio Format is Best?

This applies to web games as well as normal games. If you're going to use music in your Web Apps, MP3 is the format that usually springs to mind first. But it's not supported by either Firefox or Opera. Those browsers support only Ogg Vorbis and Wav. However (a) there are other browsers and (b) there are other formats. Scirra, maker of the game creation software Construct2 took a detailed look at browser music support and their conclusion is to avoid MP3, as it has licensing costs for encoding music. You can use AAC, Apples's lossless format, which is royalty free for Web developers. Ogg Vorbis is completely free, so you might as well support those two formats. This then covers you for all five major browsers (IE 9, FireFox, Chrome, Safari, and Opera).

General Web Development Practices

"What should you do to prepare a web application before making the site public?" is a good question that has been asked many times, and the answers on the StackExchange programmer's Q & A site should be compulsory reading for anyone who ever does this. It's probably the most comprehensive set of answers around. The answer about never trusting users is possibly the single most important one and the popular XKCD cartoon strip highlights this perfectly. If you've heard of Little Bobby Tables, you'll know what I mean. If not then take a look. Free icons in the featured picture courtesy of http://www.aha-soft.com.