How often do you hear people complaining over PHP and quite often these rants come from smart guys. So when we had enough of these rants, we consider the good side of PHP and endeavored to enlighten you all with that.
Well, first things first. Now most often than not these rants are coming from the ones who are yet stuck in the old days of PHP. As we think from their perspective it could be either because they don’t care or maybe they are not in mood to admit that PHP has evolved at a very fast pace, not only at the language level as well as at the community level. The thing is that it’s evolving at much faster pace as compared to any other language or web platform. Though it was not always like this but yes in the last 5 years PHP did have an incredible journey.
Now before we begin with the wonderful thing the PHP community went on to attain lately, let’s consider few of the exciting numbers: PHP is used by 77.9% of all the websites whose server-side programming language is known. WordPress is used by 16.6% of all the websites in the world. When we consider the top three CMSes, for the websites using a monitored content management system: WordPress is first with 54.3%, Joomla is second with 9.2%, and Drupal is third with 6.8%. Three products written in PHP.
So, What Ultimately PHP Has Done Right?
So far we discussed how in the last few years PHP has evolved but do you know that in spite of these changes over the years, PHP remains the easier language to learn for non-technical folks, allowing even the layman to develop dynamic websites at fast pace as compared to other technologies. With it hosting websites is cheaper that too without any trouble. So even though PHP may not be the best designed language in the world but using it you can do a lot of things and there is not denying with it.
PHP, The Language:
With PHP 5.0, which came out in 2004, we got a robust object model and now we have come ahead of it with around eight years gone by. Today the latest PHP release i.e. 5.4 has all the best features you can desire for in a modern web language. It supports namespaces, closures along with support features.
Though we had to wait a longer for this one, with PHP 5.4 you get amazing syntactic sugar making the entire experience a lot better for you. It not only supports to define arrays but supports calling a method on a newly created object (). With PHP you get an array item from any expression ().
Though there were a few flaws PHP had but they have all been best dealt with now. Ultimately, now you get PHP with a built-in web server easing out local testing and it begins in just micro-seconds.
PHP, The Ecosystem:
Now when you have a good language it is quite helpful but when you have a great ecosystem it work wonders. You will be pleased to hear that the PHP ecosystem has evolved significantly in the recent past.
Now Git is all out there, everywhere and PHP went on to embrace Git a lot faster. Today all major PHP libraries, frameworks and products use Git, including PHP itself.
Sometime back it seemed better to get off the PEAR-hack I did in Symfony 1 in order to support plugins. We were keen on replacing it with something that could manage project dependencies instead of a global installer such as PEAR. After a lot it’s not easy to manage dependencies thus we attempted to get the best algorithm that could manage software dependencies. We tried everything from Perl, Ruby, Debian and Redhatt, however nothing worked well and then came ZYpp. It indeed worked for us. Using a SAT solver, ZYpp easily manages dependencies and thankfully now PHP has the best dependency manager, Composer.
It’s advised to learn Composer. You can browse Packagist, the main Composer repository having 1900+ packages available and have installed more than a million times in less than 3 months.
Community collaboration is the most significant. The good collaboration between PHP projects is essential. phpBB, Drupal, eZ Publish, Symfony, and many others (phpDocumentor, PHPUnit, Behat, Zikula, Propel, Doctrine, Midgard, …) share code. Despite being competitors, they well understand the significance of cross-pollination. Here Composer is a good enabler.
Now as we conclude, we’d like to keep it this way. Even though PHP is not the best language around, but it’s certainly the best web platform ever.