« The iPad Underwhelms Me | Main | Apple Tablet Predictions »
8:23AM

Let Them Eat Cake(PHP)

At work, we recently had a request for a mobile app for our university to use...and the kicker was that we also wanted other universities to use it and adapt it.  As a result, we couldn't use our standby for web applications, Ruby on Rails.

Rails is one of those programming things that I simply have issues with.  It is fast, it is easy, but my qualms comes with the Ruby programming language.  I simply don't like it.  I don't like the syntax, I don't like using it, most of this is because I come from a primarily C-influenced language background.  When I first started learning Ruby, it took me forever to figure out why some variables had a "@" tag and why others didn't.  Of course, I know now, but a lot of my problems come from scoping issues.  

However, even I know Rails is better than a lot of other web frameworks around, especially JSP.

So, I sighed with relief.  However, this presented a new problem - what framework do we do?  We decided to use a MVC framework, which I still think is a good idea.  Immediately, I thought of one that I remembered in the depths of my mind: CakePHP.  Other frameworks were mentioned in our group, such as PHP on Trax and the Zend framework.  

Here comes the rub: While I was able to get a small demo application of CakePHP running (using their 15-minute blogging tutorial) relatively quickly, everyone had issues trying to bring up an example of their framework.  Most were issues involving badly written instructions (like in the case of the Zend framework) or as a result of some Linux mysteries.

The only issue that I came across with CakePHP was mod-rewrite needs to be on for it to present pretty pages, and that was easy to solve (sudo a2enmod rewrite, go!).  

Furthermore, CakePHP was a joy to use, and let me tell you why.  First of all, it was as easy to use as Rails, and then some.  The only differences between Rails and Cake is that Cake has no concept of migrations (so, you have to mess with the database directly, which I actually prefer), and Cake uses PHP snippets to construct it's code.

Literally, every model and controller you use are in between <?php and ?>. 

Pretty much everything you can do in Rails is a construct in Cake, whether it's defining that a user has a profile (or multiple cats), or various Form Helper controls (which I prefer Cake's version than Rails version).  

Even routing is easy to do in Cake, and routing is still something I don't quite understand how to do in Rails.  

Let me just say this: I'm not saying CakePHP is better than Rails, I am saying, however, that CakePHP is easier for me to use than Rails.  I like the fact that PHP, although it's a strange little language with ill-devised naming conventions, is easier for me to use than Rails, due to my upbringing in C-based languages.  

I will say that my next major project will be done in CakePHP, and let me just say this - I already have plans for what it's going to be.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>