Rip's Domain

Ruby on Rails – All I need for the switch

Posted in ColdFusion, Personal, Ruby on Rails by rip747 on December 14, 2007

For a while now I’ve been looking into Ruby on Rails (RoR) to replace ColdFusion (CF) as my primary programming language of choice. There are so many things about the framework that just dazzle me to death. I know I’m comparing a language to a framework here, but to be honest, to most people there really isn’t a difference. Plus the fact that I really haven’t found a CF framework out there that I really like nor one as feature rich as RoR.

For one, I like the idea of convention or configuration (COC). How many times have you taken over an app from someone where you’ve spent days on end trying to figure out what the hell they were doing? If you embrace COC then every app is structured the same so there is no guessing at all. I can also see how COC can speed up development amongst a group of developers since everyone has to follow the same directions.

ActiveRecord (AR) is just sexy beyond belief. I love SQL, don’t get me wrong, but I grow tired of writing the same queries day in and day out (This is why I created ICEGen). Furthermore, I’ve seen some of the SQL that others have written and makes me want to throw up. If AR can help me not write the same boring SQL while preventing others from just writing it altogether, I’m sold. Coupled with the fact that the built in validation methods are just so simple to use, why would you need further convincing?

Plugins and Gems just work. I’ve seen frameworks in ColdFusion claim that you could write or download a plugin, install it and it would just work; yeah, well it doesn’t. Half the time I’m hunting and configuring files all over the place only to expense my efforts in vain. With RoR, just a simple command line and within seconds the plugin and gem are installed and work beautifully. Sure sometimes there is a little configuration to do with them, but at least in the end the plugin works as expected.

I don’t do tests, I just don’t. I’ve tried using CFCUnit and failed since it warped my fragile little mind. Tests in Rails are dead simple. Because of this, you can’t even submit a patch to the RoR team unless you include your tests. This is all done thanks to fixtures.

Those are a few things that I just love about RoR, now let’s see what huge things it’s missing that CF has.

CFDOCUMENT – What CF developer today hasn’t used this tag. There is something just magical about wrapping the tag around your invoice written in HTML and having it pull up a PDF or Flashpaper file in the browser. No need for them to have Acrobat installed so they have to print the page to PDF, it does it all for them and it’s dead simple to use. RoR doesn’t have this. PDF::Writer sucks balls and it’s hard to use. HTMLDOC doesn’t support CSS so it’s impossible to get the page to look good. Plus Flashpaper it’s even an option.

CFIMAGE – Yeah I know we just got this tag, but before you could just download imagecfc which worked just as good in my opinion and you had your image manipulation. RoR has support for ImageMagick which, if you’ve ever used it, is a dog. It’s slow as hell and doesn’t scale worth a shit. I still to this day can’t believe that this library is the defacto amongst the open source world.

As you can see there really isn’t a lot that CF offers that RoR doesn’t already have. Hopefully the RoR team will see these shortcoming and create some plugins that address them soon. For now I’m still learning and loving RoR.

About these ads

4 Responses

Subscribe to comments with RSS.

  1. Rey Bango said, on December 14, 2007 at 4:09 pm

    Tony, before jumping ship, just make sure you can sustain yourself w/ work. Right now, CF is experiencing a bit of a resurgence. I’m not sure how RoR is doing, especially here in FL.

  2. rip747 said, on December 14, 2007 at 4:35 pm

    @rey,

    I wouldn’t think about just completely jumping ship and abandoning CF altogether, that would just be stupid. CF is where I make all my money :) I just really want to learn something else and RoR seems like the thing to learn.

    Right now, when I do a side project for myself, I’m doing it in CF. What I really mean by this post is that I want to start doing those projects in RoR.

  3. Rey Bango said, on December 14, 2007 at 5:51 pm

    @tony: Gotcha. Makes sense.

  4. Al Davidson said, on February 28, 2008 at 10:02 am

    Hi Tony,

    I don’t know about PDF generation, but I must say I’m surprised you’ve had a bad experience with ImageMagick. Yes, it can be a pain to install (especially on Windows servers) but once it’s up and running I haven’t found any other free product to even come close in terms of speed and quality.

    On one particular recent CF site – http://www.motoraddicts.com – we started out with ImageCFC in development, but it became clear that we needed better image quality and faster processing for deployment. So we moved to ImageMagick, and never looked back. That was a couple of years ago now, and I’m in a different job now, so I can’t *guarantee* that they haven’t switched to something else again, but I’d be very surprised.

    Al


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: