Why PHP?

We already have Perl, we already have Java, and both claim they can do the job on the web. So why introduce another language? Why use PHP?

P stands for Pragmatic

PHP is just the smallest tool that gets the job done. Why use anything else than a hammer when you just want to pound a nail in the wall.

Together with MySQL, PHP provides a simple and complete web solution on the server side. It is simple: you can create very quickly a web prototype. It is also highly scalable: some of the largest web sites use PHP.

Whether the task is to generate HTML, manage sessions or interact with a database, PHP always comes with a very simple solution.

A simple language

Many languages have difficult concepts to grasp; some of them are even weird at times. This is not the case for PHP. In fact, if you know any modern language, you should be able to learn PHP quickly.

The simplest tool for the job

PHP is a simple scripting language and you can certainly write sloppy code with it. However if you want you can write highly maintainable code; actually, you can easily write object-oriented code. In fact, PHP 5 can look very similar to Java (with one big hole: no packages/namespaces).

The best feature

The best PHP feature may seem like a little thing. The big deal is that you can mix PHP tags and HTML tags: you can put PHP code inside HTML tags, and you can put HTML tags in PHP code. This makes it a very pragmatic tool to produce HTML pages, the core of the web.

I heard at a conference that at one point Yahoo wanted to standardize their development on one language. They reviewed 10 possible solutions and they ended up choosing PHP: the deal breaker was that capability of embedding PHP tags directly into the HTML.

The best tool for web development

So, as far as I am concerned, on the server-side PHP is just the best tool for web development (i.e. web page manufacturing).
Now, I would not use PHP for anything else. But for that one essential task, it is an outstanding tool.


Leave a Reply