Ruby on Rails – All I need for the switch
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.