So I got persuaded into blogging for Sitepoint and this is my first post. I’ll be writing mostly about PHP, since that’s my main area of competence, but will probably touch on related topics.
Anyway, in an attempt to not turn this into yet another “Hello World”, I figured I would reflect a bit on what’s special about PHP.
PHP doesn’t do stuff
It basically boils down to one thing; PHP doesn’t do stuff for you.
Taking a look at the hordes of extensions, which comes with PHP by default — or the overwhelming array of core functions — it may appear that PHP does an awful lot of things, but it doesn’t. Not really. This functionality is mostly passive; When you look at the language core, it makes very few assumptions about the application, you’re going to build. Instead, it supplies the tools to do so.
This is the tradition of open source. Linux is renowned for having a multitude of desktop environments, shell interpreters and whatnot. PHP follows the same organisation. It does have a one pivot point though; The language itself has only one official implementation. Well, two actually, but that’s hopefully going to be fixed eventually.
PHP doesn’t have a framework ..
These days, application frameworks are all the rage. Simply put, a framework is a body of rules for how you write an application, backed by a collection of libraries to support this specific way. The rules guide you, when building your application, and the libraries integrate better, because they can make assumptions about your application.
Rails was the one lifting it from a fad to the hype it has become, but PHP has its own fair share. It should be no surprise, given the diversity of extensions and libraries for PHP, that there isn’t a single defining framework, unlike most of PHP’s competitors. That’s a bit of a problem, since frameworks tend to be mutually exclusive — At least to some degree.
.. and it won’t either!
Some might say it’s a matter of time before one will rule them all. I rather believe, that the unique nature of PHP is exactly in its diversity. This diversity is ensured through the lack of a single application framework, which is tightly integrated with the language.
That’s not to say, that there isn’t room for frameworks, but it will always be in plural. This makes them fundamentally different than the monoliths of Ruby or .NET. Whether that is uplifting or depressing is a matter of personal temper, but it’s indisputable.
Now, that should prompt some comments.