PHP CMS packages are bad, mmkay?

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.

Subscribe to Blog via Email

Enter your email address to receive notification about new posts.

  • http://framework.zend.com Wil Sinclair

    Actually, it’s Pádraic Brady, I believe. :)

    ,Wil

  • http://www.techfounder.net Eran Galperin

    Makes you wonder, doesn’t it ;)

  • http://volomike.com/ Volo Mike

    Have you ever compared Drupal and Joomla? I made a product matrix of CMS packages for my client, and then a questionnaire on what he likes and doesn’t like. I then was able to zoom in on the product choices and that left Drupal and Joomla. My client said he’s used and liked Drupal. But I’ve heard bad stuff about Drupal, as well as what you state here, and good stuff about Joomla, so I’m trying to decide which is better. He asked me to build him a feature list comparing the two, and zooming in more than I had previously in comparing them.

  • Eran Galperin

    From a developer point of view, I prefer Joomla’s code since it has some OO structure even though it’s legacy PHP4 code (which means strict errors in PHP5). Both libraries suffer from overuse of globals and defines (which is not surprising, this is how you did those things in PHP4) and insufficient documentation (PHPDoc anyone?).

    I don’t have extensive experience with either of those packages. I tried them out, saw the STRICT errors, tried a couple of plug-ins and realized this is not an upgrade over WordPress which has all the plug-ins I need for a CMS. For general purpose CMS I rather roll my own.

    You can read about a comparison in this nice article I saw some time ago – http://www.communicopia.net/blog/joomla-versus-drupal