Saturday, January 5, 2008

Rails 2.0 - I'm outdated...

For my new project, I decided to use an existing application that I wrote as a base for a new application. Of course, in undertaking this task I figured I had better get the "latest and greatest" for Rails.

OMG...this made me realize how OUT OF DATE I am! Mind you, I wrote my application over two years ago for our "other biz" - and I wrote it at a time when Rails was still in Beta. Mongrel - ahhh...I'm not even sure it was thought of, much yet conceived. I have since made sure that my "old app" worked with probably up to 1.2 Rails. So imagine my shock when I upgraded to Rails 2.0! Ughhh... I've fallen behind even while using the cutting edge stuff. :-)

Major diff's: RESTful! But even down to the smaller things, like Pagination. Oh, the rails boys always complained about pagination, but damn - they took it out! LOL... that's okay - we now have WillPaginate! Hah...it's still a change and something that took me a little research. Scaffolding (another thing the critics of rails have always bitched about) is different. Why doesn't someone understand the value of QUICKLY creating a skeleton for CRUD operations? Ohhh...the pundits - damn them. Scaffolding is different for sure - and I'm not happy about that! ;-) If I want to quickly have some views created then let me do it!!! Okay? It's just a change, that's all.

The whole REST stuff - that's a little more work! Work being education. Things change - that's life. Decision time: Do I stay the course on Rails 2.0 or stay on my old stuff that works knowing that my time is severely limited. Dang... of course, I'll go Rails 2.0 - I just hope this is a wise decision! I had a lot of repeated code for simple stuff in my original project which is a violation of the Rails principle - DRY (don't repeat yourself). BTW - this could be my own fault and not the fault of Rails - when you learn something quickly you don't always learn the RIGHT way to do it. Search, Pagination, etc... stuck in the controllers. This is different now. I just hope that I don't run into a ton of app changes as I start to port to 2.0 for a new purpose.

BTW...I, like many others, LOVE (absolutely) Ruby - and thus ROR. Years ago, I went down this path when searching for a canned, open source solution to my needs. I stumbled upon Rails and have never looked back. I wrote my own solution in less time than it took me to evaluate and modify existing solutions to my situation. I remain commited to the ROR cause. DHH (if you don't know who that is then you shouldn't read this anyway) is certainly, and self-proclaimed, opinionated. A bit of an ass indeed (as am I). However, he's created something that I think leads to faster web development than any tool I have ever seen - and it's a great contribution to the Open Source Community - all the better, which even removes the ass-itch! ;-) Thanks DHH! 2.0 it is. You are a brilliant architect and I'm grateful for the robust and growing Rails community.

-M

4 comments:

Brick said...

What is your feeling on Iron Ruby and Ruby integration with other frameworks (in the case of Iron Ruby that would be Microsoft's .NET)? I have only played around with Ruby and have never even looked at Rails. BTW, it bugs me that most frameworks do not include some kind of canned CRUD infrastructure. Seems like this gets reinvented every time you turn around.

The Four Hour Trial said...

Brick,

ROR has "canned crud" via scaffolding. It just so happens that they changed it pretty significantly somewhere between 1.3 and 2.0! I'm finding that a lot of things have changed! I guess that's what I get for not staying on top of things.

If you haven't played around with Rails, and if you already know some Ruby, then you should check it out! If you run on windows, then I suggest InstantRails as a quick way to get everything installed and running. I used to use RadRails for a development environment, but it has been taken over by Aptana Studio - pretty slick.

As for Iron Ruby - I have never used it. VS.NET is, bar none, the best development environment I have seen. It looks like Iron Ruby is just making use of the CLR (DLR) to allow you to program in Ruby within .NET instead of, say, C#. While that's cool - it doesn't give you what Rails gives you. Rails is a framework architected around the MVC design pattern and "heavily influences" you to adhere to certain "common sense" guidelines. It is QUICK and EASY to get a very functional web site up and running in VERY LITTLE time with Rails. Ajax, oh yeah! It's there. The only thing missing that I would like to see is a visual design similar to what you get with VS.NET.

Let me know if you check out Rails and what your thoughts are about it.

Thanks for the comments!

-M

Brick said...

I finally got around to trying Ruby on Rails. I installed Rails version 2.0 and RadRails, because I love IDE's. The first problem hit me right away: almost all the tutorials and books for Rails are pre-version 2.0 and as you noted, the differences are quite significant. I could not get RadRails to work initially (it works for me now) and reverted to the command prompt and a text editor.

Keep in mind this is coming from a novice: Rails 2.0 requires less work to get an application going than in the previous versions based on the tutorials I had at hand, but it seems that dynamic scaffolding is not available. I wanted to add a database table column after the fact and I ended up hacking the view directly to get it to show up in the browser.

So it is very cool and I will try to put something neat together as a practice exercise.

The Four Hour Trial said...

Brick,

This suggestion may put you over the edge, but I found something VERY cool that I think you could potentially benefit from too. It's tough because you don't know rails yet, but it give a LOT to you.

Ready?

http://www.hobocentral.net

It's very cool - but will add to your learning curve. If you stick with Rails 2.0 the way it is then you may want to install the scaffolding plugin! Also, you should be using Aptana Studio instead of RadRails (Aptana took it over and has some very nice enhancements).

-M