We’ve been baking!

Posted by Luca on February 12th

Hello again everybody!

Appologies for not posting in the last two weeks, but I have been busy baking and James has been busy, well I don’t know as his internet connection at uni is still playing up.

Anyway, I was looking for ways to improve my MVC system so that it could handle complex SQL queries and I came across another MVC system called Cake PHP.

I thought I would give it a go quickly, and wow, I was impressed. It is near enough the same as Ruby on Rails, and in some ways better (althought I am sure the diehard RoR fans would disagree). Deployment is easy, and unlike RoR doesn’t need you to fiddle with anything complicated on your server. Plus it is PHP based which almost all webhosts support, so should run near enough anywhere. The main advantages over my MVC system are that it includes a proper Active Record, caching, probably better security, and tonnes of other things. I decided rather than trying to reinvent the wheel, I would ditch my system for one which lets me get on with programming Juvely, which is now a piece of Cake.

Other things that have been useful are the great documentation. It doesn’t go too indepth in topics (which is good for the begginner) but explains more than enough to get on with your first app. There is also the so called Bakery, a wiki that contains “everything CakePHP”.

The engine itself in my opinion is much more user-friendly that Ruby On Rails, the error messages are beautiful. They don’t contain anything unneeded and clearly explain what the problem is, and even suggest a solution. For example, say you go to an URL for a controller that doesn’t exist.

Rails Error Message

Ruby just spits out an error message saying the route was not recognised.

Cake Error Message

Cake on the other hand spits out the error message, details of how to customise the error message, and what you need to put in what file to fix the problem.

As with everything it also has its disadvantages. I spent ages trying to figure out why my HABTM relationship wasn’t working, eventually to find out I had my array in the wrong order. Also the main site for pluggins and addons is by default in French. In order to view the English version you need to register (in French) and then change your language preferences, it would have been much nicer just to have some language buttons somewhere, but heh.

Anyway, CakePHP looks very promissing, and I expect to see a lot more of it in the future! After being public for under two years it looks like a lot will come out of it!

« Previous Page