RUBY on Rails
Posted by Doug Fri, 08 Jul 2005 15:58:00 GMT
A friend of mine is still stuck in .Net land. We have discussions about Ruby on Rails from time to time. That’s why I was pretty interested to find this thread on the mailing list about a “Rails in .Net”. There are several “Rails in Foo” projects to implement the ideas of Rails in various languages. All in all, I like to see environments try to learn from each other and all grow. After all, Rails is “just” a good implementation of some solid design patterns for web development. It has some nice helper methods thrown in to improve testing and also HTML/AJAX generation. Theoretically, you could implement Rails in almost any language. Don’t be misled though. It’s called RUBY on Rails for a reason. The strengths of Ruby really shine in Rails. I was once asked, “Could you implement Rails in Perl?” The answer is yes. In fact, prior to picking up Rails I had attempted to do just that. It was hard work and very complicated code though. Ruby makes this stuff a lot simpler.
There are a few MVC frameworks available in Perl.
A few have been available for quite sometime…Maypole is one ( now defunct and not nearly as versatile as Rails )
Catalyst is another one, which is VERY good in my opinion. It has some design features that I think would be GREAT if they were apart of Rails http://catalyst.perl.org
Yes, I’m well aware of both Maypole and Catalyst. My point in this post though is that (putting on flame-retardant underwear) is that Ruby is better suited for this type of stuff than other languages… including Perl.
My friend, Dave, dug out an old IM quote from me just yesterday:
<blockquote>Tuesday, July 22, 2003: (15:23:47)lathinet:i’m becoming increasingly convinced that perl is the ideal web language (over lisp)</blockquote>
Less than a year ago I would have done double-back-flips to have a full-time job doing straight Perl programming. It’s funny because today I’d take that job, but wish it was Ruby.
I still use Perl for command line data processing (such as one-liners or quick scripts), but Ruby is my favorite language for web development now.
There are a couple reasons for this. First, Ruby’s OO(Object Oriented) implementation is very nice. Much nicer than Perl 5’s. Second, I think Ruby’s reflection is better than Perl’s. Here’s a bonus reason, I like Ruby’s block passing.
I’m not here to tell you that you shouldn’t be programming in Perl (or Python or PHP; well, maybe PHP). In fact, I’d love it if more of you would hold off another year before switching to Ruby on Rails. That’d give me more time to establish myself as a “go to guy” for Rails programming. What I am saying is that Ruby on Rails is the most natural fit for me.
I totally agree. I love Ruby and really like rails.
I was totally put off by the way Ruby looked at first glance ( reminded me of BASIC ), but once I started playing with it, it really grew on me.
The only reason I mention Catalyst is because there are a few things they had imnplemented in the first initial designs that I think Rails should adopt.
The first being main-sub-controllers-controller(I can’t think of a better term).
In catalyst if you create a controller ( or model or anything ) like a directory like “admin/controller1 , admin/controller2” then there is a controller file below that directory called admin_controller that lets you affect all the other controllers in that admin directory ( did that make sense ? )
The other thing I liked about it is not really a Catalyst issue, but just Perl in general….the CPAN. The only thing I don’t really dig about Ruby at the moment is its lack of a vast archive of code. If its something simple or abstract, the CPAN has got it. This also aids in development time if you’re trying to tie a LOT of complex tasks into a single app.
With all this in mind, I still am doing all my web development with Rails, for reasons I won’t go into now because I feel I’ve already written enough :)
It is worth stating that Maypole is not defunct – 2.10 was released over the summer and 2.11 is due early november.
Development has been very active and we are starting to see a lot of applications and sites built by users. Hopefully we should have a good selection of applications ready to run and linked from the website by chrimbo.