Something that keeps bothering me is how badly written the major CMS packages for PHP are. Yes, I’m talking about wordpress and drupal amongst others, that are so insanely popular but are just as insanely procedural hack-fest mess.
Lets get this out of the door – I’m an Object Oriented guy. I strongly believe OO methodology to be superior in so many ways to procedural code. Given that, I have seen procedural code that is very neatly organized (almost to the point that it emulates OO standards using function hierarchy). WordPress and drupal code however, is not.
Massive use of global variables and generic named functions with no apparent relationships make tracking and modifying the code needlessly tiresome and difficult. WordPress also raises ‘strict’ warnings right out of the box, due to the use of old PHP4 coding standards (such as passing objects by reference). And code documentation? forget about it.
I suspect that these outdated code designs are still in place due to the massive base of plug-ins developed for those packages which depend on the old architecture. And it’s those plug-ins that make those CMS packages so useful (otherwise it might seem ironic that I’m writing this in WordPress. It’s just that I don’t have time to re-implement all the functionality I can get ready-made).
Maybe sometimes soon a high-standards package will come along with a well-designed architecture and phpDOC documenation of the bat. Brady Pádraic has written a series of tutorials on his blog system (part 1 of 7), written with the Zend Framework. I’m waiting to see how that comes out.
To know when the next article is published, please subscribe to new articles using your Email below or follow me on Twitter.