Amass

Why PHP gets picked

April 27th, 2007 Luke

Lately on a few forums that I lurk, more and more people have been signing up and saying something along the lines of “yar, how I makez t3h browsargame?!!!one”.

I don’t really mind people like that. I might mind their grammar, but I don’t mind answering the question or giving them an idea of what direction to take. Generally what I recommend to them is that they plan their systems out, pick a language with the features that they want(I usually list off Perl, PHP, ASP, and Ruby or Python), settle on a database system that works with their language, and go to it.

But for some reason, everyone settles on PHP. I see little to no people mentioning developing browsergames in Perl or ASP or any other language, but topics about browsergames in PHP proliferate; there’s a new one every half hour!

I think that PHP gets selected by most, because it is easy. That’s the only reason. A person can easily sit down and write this: <?php echo 'Hello, World!'; ?> Whereas to do the same thing in Perl, we would need this(on the web): #!/usr/bin/perl -w use CGI qw(:standard); print header(); print "Hello, World!"; This leads to people picking PHP because it’s so easy; they can drop their code into a page along with their HTML, and there are no repercussions. This lack of separation between design and logic drives me insane; I don’t much like working on PHP code that hasn’t been separated nicely.

Ultimately, though, that’s what it comes down to: people who write PHP and steadfastly choose PHP have chosen it because it is easy to embed their code directly into their page, and because PHP has a substantially smaller learning curve than the other languages. Whether it’s actually a viable language for people to use seriously is something that’s been debated for ages now, and probably still will be.