Version 1.0 of the Ruby-based web development framework, Ruby On Rails, was released last week, which prompted me to revisit it. I'm very happy — they seem to have eliminated most of the complaints I had with it (mostly things like instability and inefficiency), and it now appears to be a perfectly usable development platform. Last time I tried it, back around version 0.12.1, it had some issues like deadlocking with 100% CPU usage when it encountered a syntax error in your code, and doing redundant things like saving all your objects in the database with every page load even if they weren't changed. Both of those are fixed now, along with pretty much all the other more minor gripes I had with it, so I think I'm ready to embrace it on BinRock.
Over the weekend I started rewriting the photo gallery in Rails, and, surprisingly enough, I've already pretty much got it done. It still needs a little fine-tuning, but all of the basic functionality (navigation, automatic thumbnail creation and resizing of photos, etc) is all working. I'm amazed. It took me five years to develop the gallery to this point in PHP, and I've pretty much duplicated it in three days in Rails. Obviously, that five-year development was a very incremental process, but there's still no way I could have written it again in PHP in anywhere near this short of a time. It has been such a delight to port it; as I went through the PHP objects where most of the logic is contained, I found that about 70% of the code could simply be discarded, because the functionality was available natively in Ruby or provided by Rails, and the remaining 30% became much more concise and clear when translated to Ruby.
One of my favorite aspects of Rails is the complete object-oriented representation of data. This is something I've been striving towards in the PHP version of the site, but even with PHP 5's improved OO support it just doesn't compare to Ruby. I haven't had to write a single SQL yet in the Ruby version of the gallery (though Rails does provide the ability to use SQL directly if the functionality you need isn't provided by the framework).
What's more, Rails makes it trivial to use cool features like Ajax in your development, so once I'm done recreating the site as it currently stands, I'll be adding some nice little touches with features like that. I hope to have the new version of the photo gallery up within another week or so, and then I'll start working on porting the blog.
Posted by Antonio 21 minutes later
You know, RoR has an inherit impregnating function. All you have to do is call it and you can have it's babies (another advantage to PHP, which would just make you miscarriage).
Looking forward to seeing the RoR page.
Posted by Dan 17 minutes later
irb(main):001:0> rails.wearing? :perfume=> true
irb(main):002:0> rails.copulate!
=> "Oh yeah!"
irb(main):003:0> rails.pregnant?
=> true