PHP and why you should use it

PHP is a programming language that is arguably one of the easiest to learn, cost efficient and common languages out there. It is used primarily to create dynamic website content. By dynamic I mean that it flows and it can change in a way that static website content can not.

With so much time invested by individuals and businesses in establishing themselves with a programming language, bias is inevitable, and you don’t have to dig deep to find someone criticising PHP. But then, the same goes for any language. Each has their own advantages and disadvantages.

What remains a fact is that PHP has been popular in the past, is popular now, and will continue to be popular well into the future.

Some of PHP’s advantages include:

  • Considered easy to learn as far as programming languages go, meaning it is very well known in the web development community
  • Hosting is more common and cheaper than for any other language
  • Large range of turnkey php applications available, some free, some not. Examples include WordPress, (the software this forum is running on), phpBB and wikipedia.
  • Abundance of free online resources

Here is a classic usage for PHP;
Situation – A shop owner wishes to supplement their traditional shop with an online shop, in the form of a 500 product website.
Solution A: Build a static website, and make 500 separate pages to accommodate each and every product.
Solution B: Build a dynamic website, create 1 product page and create 500 database entries

So what is the difference? In any case, the shop owner / web developer is going to have to process 500 products. Sure this sucks, at least initially.

PHP starts flexing its muscle when we get to the ongoing management side of things. The shopowner has decided that the product pages would convert better if the pictures were at the top of the page, instead of at the bottom;

Static Site: guess what – 500 product pages = 500 pages to download, change and upload – say goodbye to your trip to the beach this weekend!
Dynamic Site: 1 product template = 1 file to change, 500 ‘pages‘ updated in one foul swoop.

The reason for this miracle of time saving is because PHP, in combination with a database language such as MySQL can join forces to create what you seen in your web browser on the fly. As a page is loaded, PHP instructs the database to return the relevant information for the product in question.

This is but one hypothetical situation – but instantly you can see the scalability of PHP. This is really only the tip of the iceberg.

One of the cool things about PHP as one delves into the “web development” field, is that as you look for more and more advanced concepts every day, the inbuilt functionality is sure not to disappoint. I’m yet to hit a point where I think, “damn I wish I could do that in PHP!”.

Perhaps years down the road one might hit this roadblock, but as long as the team behind PHP keep there eyes on the ball, and the community remains strong and innovative, that day will*never* come. The point here is that who knows where the internet will be in 10, 20 or 50 years time.

Further Reading:
Comparison of Programming Languages
PHP Usage Graph
Programming Movers and shakers

Leave a Reply

Your email address will not be published. Required fields are marked *