Monday, January 26, 2009


The idea is on the table, excitement is in the air. Now where do we start?

Let's start basic. Choosing how you are going to make your game is a great place to start making it. There are a number of perfectly good solutions:

  • PHP
  • ASP
  • Ruby on Rails
  • Python
  • Perl
  • Insert other languages here

If you had asked me to make this decision a year ago, the answer would have easily have been PHP with a MySQL database. After all, I've been coding in PHP for 7 years. Plenty of large-scale webapps utilize it, plenty of large-scale PBBG's utilize it... why shouldn't I?

Rather than tell you why I will not be using PHP/MySQL, I'd rather tell you why I will be using the Google App Engine (GAE):

  • Cost - GAE is absolutely free at this point, although premium version are in the works.
  • Performance - Google handles load balancing and performance scaling. To do this myself, I would be looking at having to rent or own multiple dedicated servers, and maintain the server hardware and software myself. I just want to code, I don't want to play the role of server admin as well.
  • Security - Servers are hosted by Google. No need to worry about DoS attacks, or utilizing my own dedicated line to keep a box up and running, or worry about remote maintenance if I rent one. Transaction security across the datastore is also handled by Google.
  • Django templating - Separating design and code has never been easier. There are good PHP solutions for this, but they simply do not compare.
  • Python - I couldn't ask for more. I could go on forever about this. Pre-compiled routines, indent organized blocks, and an overall fun experience.
  • The Google Datastore - Google utilizes Big Table for the database. Interfacing with it has saved me countless hours of debugging and security checks. Being able to create a new entity in my datastore is as easy as:
new_user = User() = "Brandon"

A new User with the name Brandon has now been created and saved in my database. No need to run a function to connect to a MySQL database, because the connection is already implied. The days of designing the database tables are over. Using the example above, designing an entity is as follows:

class User(db.Model):
name = db.StringProperty()

No need to create primary keys, or connect to the database and execute SQL queries to create my tables!

I would absolutely agree with anyone who says that PHP is a great "out of the box" language. It is easy to pickup and learn, and designing webapps can be fun. Small-scale apps are much quicker to design in PHP, due to the fact that there is little to no prep work. However, once the GAE project is created, the countless hours saved cannot be overstated. I've developed with PHP for many years, and after the initial discomfort of switching to Python, I am completely at home.

With my hosting, coding language, templating system, and database all taken care of, I can focus on starting my app. Now the next big decision:

Focus on code? or Focus on the web design? I've already got my answer, and this will be in my next update.

No comments:

Post a Comment