Ruby on Rails.
Not a Framework. A Container.
I am one of these average Java developers that get impressed by all the RoR hype. Just reading other's blogs and passionate polemicas is not enough to get your own view, so I gave it a try.
So it's true. It's true that the tool allows you to create a webapp very quickly.
But after trying it out, I am less impressed than I was before, affected by all the hype.
The biggest disappointment for me is that RoR is not a framework. It is a webapp container.
When you create your great app, let's say Model layer, it has to live inside RoR. The my_model.rb file has to reside in a specific dir. The class inside is tied to ActiveRecord via inheritance. The file itself does not even 'compile' in Ruby (yes, I know it is an interpreted language...), because it misses needed 'require' statements. It is hard to reuse this Model layer or any other component in other webapp in a different way than copy-paste. It can be done, but needs being careful and disciplined. But I know that it usually is just an invitation to 'let's build something quickly and we'll clean up afterwards' hell...
Agreed. The startup is superfast. You see the changes once they're done. But you have to trade-off a lot of flexibility to get that. RoR container is much more restrictive than the J2EE ones, so bashed by so many people. All RoR advantages in fact are its quick startup + Ruby inside...
And speaking for Ruby. I like the language quite a lot. My first love in field of programming languages has been Smalltalk, and it always occupies a prominent place in my heart. Ruby has quite a lot from Smalltalk elegance.
But let's face it - Ruby is far from being mature. It's pretty slow. It's controlled by one person. Some built-in APIs are horrible (why File and Dir does not have common ancestor for example?), and there is a lot of inconsequence (although it is much better now that it was a few years ago, so things are improving).
One thing that could highlight my point is Ruby installation. When you install it, everything just works. You type 'ruby', you have it. You type 'gems' - voila. But try to install different Ruby version in different dir. Or try to have 2 different components relying on 2 different versions of the same gem. Now life is starting to get really hard...
So, the end of the story is as usual - don't believe hype. Although both tools are good and perfectly applicable in some types of development, they're not silver bullet. Good ol' Java still has some its advantages, and I think I am so productive in it that RoR is not giving me that much benefit...
So it's true. It's true that the tool allows you to create a webapp very quickly.
But after trying it out, I am less impressed than I was before, affected by all the hype.
The biggest disappointment for me is that RoR is not a framework. It is a webapp container.
When you create your great app, let's say Model layer, it has to live inside RoR. The my_model.rb file has to reside in a specific dir. The class inside is tied to ActiveRecord via inheritance. The file itself does not even 'compile' in Ruby (yes, I know it is an interpreted language...), because it misses needed 'require' statements. It is hard to reuse this Model layer or any other component in other webapp in a different way than copy-paste. It can be done, but needs being careful and disciplined. But I know that it usually is just an invitation to 'let's build something quickly and we'll clean up afterwards' hell...
Agreed. The startup is superfast. You see the changes once they're done. But you have to trade-off a lot of flexibility to get that. RoR container is much more restrictive than the J2EE ones, so bashed by so many people. All RoR advantages in fact are its quick startup + Ruby inside...
And speaking for Ruby. I like the language quite a lot. My first love in field of programming languages has been Smalltalk, and it always occupies a prominent place in my heart. Ruby has quite a lot from Smalltalk elegance.
But let's face it - Ruby is far from being mature. It's pretty slow. It's controlled by one person. Some built-in APIs are horrible (why File and Dir does not have common ancestor for example?), and there is a lot of inconsequence (although it is much better now that it was a few years ago, so things are improving).
One thing that could highlight my point is Ruby installation. When you install it, everything just works. You type 'ruby', you have it. You type 'gems' - voila. But try to install different Ruby version in different dir. Or try to have 2 different components relying on 2 different versions of the same gem. Now life is starting to get really hard...
So, the end of the story is as usual - don't believe hype. Although both tools are good and perfectly applicable in some types of development, they're not silver bullet. Good ol' Java still has some its advantages, and I think I am so productive in it that RoR is not giving me that much benefit...


3 Comments:
You have a number of misconceptions about RoR, it seems. To address some of your points:
"When you create your great app, let's say Model layer, it has to live inside RoR" -- this is not true, for a good example of someone learning Ruby (and Rails) doing exactly the opposite see Sam Ruby's "Rails Confidence Builder" at http://www.intertwingly.net/blog/2005/08/09/Rails-Confidence-Builder where he quite specifically uses AR outside of the "Rails Container"
"The file itself does not even 'compile' in Ruby (yes, I know it is an interpreted language...), because it misses needed 'require' statements." Try compiling Java with missing import statements. Same thing.
"controlled by one person" -- Actually, there are twelve committers at present: http://weblog.rubyonrails.com/archives/2005/09/24/rails-commit-team-jumps-to-12-members . Or, maybe you mean *Ruby* is controlled by one person, which is even less true. Sure Matz gets most of the credit, but it is like crediting Gosling with Java, Kay with Smalltalk, Steele with Scheme, etc.
"One thing that could highlight my point is Ruby installation. When you install it, everything just works. You type 'ruby', you have it. You type 'gems' - voila. But try to install different Ruby version in different dir. Or try to have 2 different components relying on 2 different versions of the same gem. Now life is starting to get really hard..." So, umh, how do you do your versioning with Java, or C? If you have one Smalltalk image do you get upset because a different image doesn't also have stuff you have put on the first? Seriously, get a grip here. Different installations of Ruby are... different. Library versioning is actually handled better in rubygems than almost anything I have seen as you specifically *can* have different versions installed in the same system, and your app can depend on a specific version.
Hi,
Great you have commented. Opportunity to learn more. ;) But I still miss some explanation. If you say that Ruby is not controlled by one person, how to understand this Matz' statement:
"From my experience and observation, an open source software needs to
have running code before the ball rolling to success. I think I need
to work alone until the first running version."
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/76588
So when Ruby 2.0 will be released? How it will look like? What will happen to it if let's say Matz is unable to proceed with his work?
Honestly, the Ruby future is not all that clear for me looking at that... But I am more paranoid than average perosn is.
The most amazing thing to me when I first looked at rails was not the language, or active record, or ajax, or MVC. PHP, .net, Java all have equivilants. What I thought was really great was that rails is a development guildeline.
Having worked in a small shop we spent a lot of time coming up with best practices of naming conventions, file locations, test setup, test refresh, etc. Rails seemed to give that out of the box.
That's what seemed the most powerful. Therefore it's completely plausable to see php on rails etc (I haven't looked but I assume there are some already). It just seemed that rails was a framework based on YAGNI (you ain't gonna need it) and seems to have kept to that. I hope it does.
I program in Java for my day job and it seems to be built for the 1 percentile enterprises at the expense of the little guy. I would really like to see some of this simplification in Java but for now rails seems to be the only one that I have cared for.
PS. found this post through technorati
- rob
Post a Comment
<< Home