I used to hate PHP. I still do actually, even if it’s only just a bit. But, over the past year or so I’ve developed an appreciation for the language. OK, as a programming language it is pretty odd. I mean that syntax, c’mon. Some weird demon child offspring between C and Perl. It’s a pretty hideous creature. Furthermore, PHP cannot be considered a platform like .NET or J2EE. It’s a programming language, nothing more and nothing less. Anything you can code with PHP can be done in as many different ways as there are PHP programmers. In a way it reminds me of the good old C days. C came with a massive library of incoherent functions. E.g. with C there where multiple of different ways of working with files. You use the set of functions that would make to most sense to you. In a sense, the biggest difference between PHP and C is the lack of pointers…
I believe that the power of PHP doesn’t lay in the programming language itself, because any serious programmer can confirm that the language is pretty frustrating to work with on a day to day basis. No, the power of PHP lies in its availability. A programming environment like ColdFusion, Java or even .NET is much more powerful and structured. Not that you can do more with these languages than with PHP, but it provides a common ground for programmers to start off with. The problem with ColdFusion and Java is that you can’t get it hosted, unless you’re willing to shell out the big bucks. Most providers offer Windows hosting so hosting ASP isn’t outside the reach of small time web developers and whipping up some old school ASP isn’t that much different than doing PHP. With .NET that’s a different story. Unfortunately, to effectively develop for .NET you need the Visual Studio development environment which you can buy for lots of money from Microsoft, making the platform unavailable for a large group of developers. I’m sure Micorsoft provides a stripped command-line SDK, but that doesn’t make the environment more approachable for people who don’t have the budget to buy Visual Studio.
The typical web developer likes PHP because every cheap hosting enviroment has at least PHP 4. And even though PHP 4 lacks some OO functionality, you can create pretty good applications with it. Other than that, there is so much information available for PHP available that’s being able to be grasped by not only the hard-core coders but also the the guy who just wants to store some stuff in a database and doesn’t want to get to much involved in the details of the language. Because of this, there are a lot of web developers using PHP. Which in turn means that a lot of companies use it because it has a large resource pool. So, even though PHP isn’t the most elegant programming language, it is popular because of these reasons.
