I have been bouncing between web development frameworks for a little while. So this is a quick tale of my experiences with a couple of them.
First off, all of these frameworks are really great, this is not meant as a “this framework is better then that framework” thing. Just my thoughts and finally the decision that was made as to which technology/framework I will use for current and future projects.
First off – the frameworks I have bounced around and used over the last little bit:
There have been others, but these two are the two that I have used the most. My idea to go to Python was initially because of language features and performance. Python is a really great language that I enjoy developing in. The use of mod_python and apache with a great framework like Django is very appealing. Django is one of the hottest things right now in the python world, and so I jumped on that train with both of my feet.
After tweaking Apache and mod_python, I had an example app serving a consistent 500 requests per second – not too bad at all. I was pretty impressed, and I knew that that was just the start. I still hadn’t started messing with memcache configurations and load balancing architectures, which I knew that a couple of these projects would need, so a base of 500 rps was very satisfying.
The only issue I had on the performance side was the CPU. mod_python did use more CPU on average to serve the same example app written in CakePHP. That being said, mod_python and Django did serve the app faster then CakePHP, at least twice as fast. So using more CPU could be a satisfactory trade-off on that end.
So I left the PHP/CakePHP camp for a bit, and fooled around in the Django camp. Built a couple of sites, and everything seemed like it was going really well. So well infact, that I wondered why I didn’t do this sooner. Time went on, and the site started getting more and more complex, and soon I was starting to do a lot of “grunt work” so to speak.
More time went on, and I was finding issue after issue that I was having to write from scratch. More and more time was spent searching around to see if anyone else had done this or that, and try to “snap-in” code from all over the place. The end result was that I was spending more time searching, and trying, and searching again, and trying again for things online to make sure that I wasn’t recreating the wheel, then actual coding of business/application logic.
One such example was data-sets/data-grids. It is a basic, common feature to display a table that is filled with data retrieved from a database. It is also very basic these days to have it sortable, and paginated. Datasets/grids make this job very easy on the developer. I fell in love with the way dotNet 2.0 does this – it’s approach is wonderful. CakePHP also has very nice ways to deal with this, and is extremely easy to use. After searching online 15 or so minutes, I found that there were a couple of “Django” approaches from the community, and an hour+ later, did have some working datasets, but again, I felt like I was simply doing too much leg work.
That is an hour lost. Never again will I be able to get that hour back. You pile on that hour, with the previous hours of doing similar things, and you end up being a little frustrated and wondering as to why you are behind. At first it’s a learning curve, and you are expected to be slower. But after a while, the expectation is that at least you should be as fast as before. Hopefully faster.
PHP can be a very sloppy language. There is less consistency in the language, and there is a fairly large legacy of “the old ways” that PHP is still dealing with. PHP 5 was a good step in the right direction, and added some very much needed things to the language, but it has been slow to adopt for some reason.
But. But. But…..there is always a “but”.
PHP can be very nice to program in also. It is supported all over the place, has a huge community, and runs almost anywhere. Before jumping on the Django/Python train, all my web development was done in PHP for years and years. It is one of the web platforms that I now best, and am comfortable in. For me, the decision to go back to PHP, and CakePHP in specific, was a choice that I thought about, and weighed. CakePHP has really great features, is documented fairly well, and wastes less of my time.
I will say that again: CakePHP wastes less of my time.
It really was a no-brainer to go back…
So – I say hello again to cakePHP, and bye-bye for now to python…maybe one day I will go back, as I do really like the language and it’s offerings, who knows. But for now, I am back to making cake’s with PHP.