in reply to OT: Ruby On Rails - your thoughts?
I'm currently learning Rails and Ruby. Here's my experience. Basically, and I've said this on the P6 language list, Ruby is the closest to Perl6 that we have today. I want Perl6, and will joyfully use it when it's available. However, it's not, so I will use the thing closest to it, and that is Ruby. Perl is an excellent language and I will continue using it, as well. Perl has a number of strengths that Ruby cannot hope to match, not the least of which is CPAN.
BUT ... Ruby is a dream to code in. It has its shortcomings, just like everything else. But, as an experienced Perl developer, it solves the problems I have with Perl without exposing too many shortcomings to how I code. And, you cannot understand it without actually having programmed in a truly OO language that also has the same dynamic facilities that makes Perl great.
Rails is also a dream to work in. It has the same MVC architecture that Catalyst provides. But, the tools it has at its disposal are much better. A few examples:
This is in addition to what Rails does for you:
One line of code, a few items in the associated template, and it's done. How many questions do we get on PM about pagination per month?def list @product_pages, @products = paginate :products, :per_page => 10 end
That flash[:notice] line is it. But, there's more! How about errors from whether or not the update was successful? Well, through the magic of ActiveRecord, if an error occurs, then the flash is updated with the list of errors. Through the magic of the right templates and CSS, those errors are sent to the user in the edit page (because we said that if update_attributes() fails, render the edit page) and the form is sticky. STICKY! And, it's just done for you.def update @product = Product.find(params[:id]) if @product.update_attributes(params[:product]) flash[:notice] = 'Product was successfully updated.' redirect_to :action => 'show', :id => @product else render :action => 'edit' end end
The sample application in the book is a shopping cart. The fact that they consider this type of application simple enough for a demo (and it is, in Rails!) should be a good indication of the power that Rails puts into your hands. I haven't even discussed the configuration capabilities, logging, or anything else.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OT: Ruby On Rails - your thoughts?
by sri (Vicar) on Nov 17, 2005 at 17:24 UTC | |
by dragonchild (Archbishop) on Nov 17, 2005 at 20:24 UTC | |
by sri (Vicar) on Nov 17, 2005 at 22:15 UTC | |
by chromatic (Archbishop) on Nov 17, 2005 at 22:57 UTC | |
by Fletch (Bishop) on Nov 17, 2005 at 20:31 UTC | |
by dragonchild (Archbishop) on Nov 17, 2005 at 20:41 UTC | |
by siracusa (Friar) on Nov 17, 2005 at 20:45 UTC | |
|
Re^2: OT: Ruby On Rails - your thoughts?
by perrin (Chancellor) on Nov 18, 2005 at 06:28 UTC | |
by siracusa (Friar) on Nov 21, 2005 at 12:47 UTC |