Friday, March 24, 2006

Ruby on Rails

I have been working with Ruby on Rails for about 15 days now and believe me it rocks. Okay first question is what is Ruby on Rails (ROR from here on) ? Well it's a webframework like java webframwork (struts, xml, jsp, tomcat etc combined). So what is a webframework ? Lets say I have make a web application such as an e-commerce website. For this work a webserver, database server, a scripting language and HTML are needed. A database structure is created, scripting language is used to embed business logic inside the application (like let only registered users buy stuff etc ) and present the user with an output at his/her browser using HTML which itself is embedded somewhere inside that big mess of scripting language. As it is obvious from this, scalibilty and maintainence will be two big problems ahead of anyone who will be managing this application. Therefore a novel approach (which is not all that novel) is adopted of seperating view that user gets at his/her browser, business logic and database. It is not all that novel because this approach is followed in almost all the apps programmed in *nix. But somehow down the line M$ with it's "super easy" to use VB, made this line thin (usual MS bashing stuff :P ) or may be web is so closely linked to user output that everybody thought that it's better to tangle all in one.
Anyways, Ruby on Rails as the name suggests is based on Ruby language (invented in Japan and has a very clean syntax). Rails is the actual framework. Rails completely seperates the model (business model) , the view and database. And not only this, you have several scripts that auto generate a lotof codewhich make web programming extremely easy. I have been web programming for a long time now and had I been ROR I'd have definitely finished all that I coded in almost 1/3rd of the time. No seriously! I am not joking it is THAT effective. Though I must forewarn that ROR has rather longer/steeper learning curve and it takes sometime to fully gulp down the scheme of things.