Ruby on Rails and PHP MVC frameworks

by Scott Jangro on 27 February 2006

A few months ago, I got hooked on the concept of MVC (model-view-controller) frameworks as a development platform. The ultra-chic framework right now, helped by the Web 2.0 craze and the limelight of a few killer apps, like 43things, is Ruby on Rails.

I spend a good month digging into Ruby on Rails, learned the framework and the essential Ruby to go along with it. My exercise was to port an existing community site that I had already developed in PHP using my own completely unstructured style. It’s this lack of structure that I have in my self-taught, undisciplined programming that is what makes the idea of an application framework so appealing to me, especially as my projects get larger and I am no longer the only member of the development team.

I really enjoyed learning Ruby on Rails. It has an incredible community supporting it, and a really great book written by the creator of Rails, David Heinemeier Hansson, titled Agile Web Development with Rails, aka the “pickaxe book”. (Software people like to refer to books based on the picture on the front thanks to the trend started by O’Reilly Press’ line of books with a different animal on each).

As I continued through my RoR journey, a few things bothered me.

First, I felt some betrayal to my PHP roots. I’ve spent the last 7-8 years learning PHP and am comfortable there. Learning RoR felt a lot like trying out snowboarding after i’d been skiing for about 25 years. Starting out was painful and frustrating, but I was soon having a lot of fun. But I never got over the feeling that I could be cruising down that mogul field on skis while wondering if I could ever get to that level on a snowboard. Needless to say, I can snowboard pretty well now (no half-pipes or anything), but I’m back on skis.

Learning new stuff is never be a bad thing, so that alone isn’t really a problem. However, I would also be forcing the change on my business partner as well, also a PHP guy, and that’s not necessarily a fair thing for me to do.

But the real kicker was at the end of the process when finding a good place to host my Rails app. PHP is everywhere. Rails, by comparison is barely anywhere. There are several hosts stepping up to the plate, but my few attempts to find a stable hosting environment fell short. Currently, Rails runs as a CGI program. This can be terribly slow, unless you use FastCGI, an apache plug-in that keeps CGI programs running in the background so they don’t have to restart every time someone hits a page. I had a tough time getting FastCGI running on my own dedicated server (no surprise there) and turned to some shared hosting services in order to make progress. The one that I settled on had some problems, and now I’m testing another rails host.

Like skis over snowboard, PHP’s allure has brought me back looking for the equivalent framework on PHP. In just the few months since I caught the MVC bug, there seems to have been a big growth in similar PHP frameworks. There are many, many frameworks under development, as shown by this list, and a few have risen to the top. This recent list of Top 10 PHP MVC frameworks, has a good representation, but it’s difficult to separate marketing, hype, and bias when reading people’s opinions of each. I was mainly influenced, right or wrong, by this recent article, “CakePHP – a tasty solution for PHP programming“.

So, I’ll be giving CakePHP a go. While they don’t seem to have caught a hype wave (as much as Symfony has), they do seem have an active development team and community, which is critical. Maybe I can “bake” their killer app.

  • It is true any one can create a passive income at home,

    its no big deal no a days.
    You can also start off ,getting forms and all kinds of

    legal documents. Its no big deal
    there are a lot opportunities out there and all kinds of

    other affiliate marketing programs out there, so what

    are you waiting for get started.
  • kayzzer
    Hi, this is a nice article, just wanted to point that the creator of Rails is David H.H. and not Thomas
  • Going from Rails to Cake should be simpler than from PHP without MVC experience to Cake.

    I wish you well, and hope your Cake experience will be pleasant.
blog comments powered by Disqus