Home > Uncategorised > PHP Frameworks

PHP Frameworks

August 28th, 2007 Leave a comment Go to comments

I’m kind of coming to a conclusion that does not make logical sense to me as a developer.

When I first started using PHP, I wrote everything as embedded code, which had little or no structure. It worked, fairly well, but had very little structure and could be a nightmare to maintain.

A couple of years ago, I challenged myself and rewrote this website using classes and object-oriented techniques. Half way through writing it, I realised that it’s not always the best way to do things.

Having spent some more time working with class based structures (including a half-arsed attempt at rewriting this site), I still not convinced.

What worries me, is the speed at which development progresses – it’s all much slower with classes. What worries me more is the amount of resources that this technique consumes – you can end up creating objects, and child objects just to get a single count of child records in the database – if you want proof of this, check the archive page on this site, half the time it runs out of memory. This then leads on to the next problem – query efficiency. In a lost of cases, it’s fairly simple to write a query to which loads the record information needed for a page, but with a general class hierarchy you need several queries to load several record levels.

At work, we are just releasing a site using the CakePHP framework. This uses the MVC approach to coding, which seems like such a good idea on paper. But I can’t get over how much time I spend jumping between files to look at different aspects of the code, and how much of a peversity it is breaking out of HTML into a PHP code block and calling a class function, when I could easily have written the HTML in the file in the first place.

These thoughts all lead me back to one startling evaluative conclusion – may be it’s better and more efficient to go for the embedded approach after all.

Categories: Uncategorised Tags:
  1. No comments yet.
  1. No trackbacks yet.