Monday, October 17, 2005

First Impressions of Ruby and Rails

Ruby and Rails are the hot buzz of the moment. I recently bought the book Agile Web Development with Rails. I haven't finished reading it. Only read ActiveRecord (the OR mapping module and the M of MVC) Action Controller (the C of MVC), Action View (the V of MVC) and Ruby language overview. Here are my first impressions.

Rails
  • It's a very good framework. There are many design decisions that we can learn from it.
  • There are many areas that I can already see that Cornerstone on JavaScript will do better: multi-dimensional customization, a good template language, arbitary division of client and server code, much faster runtime, tight integration with Java (meaning near native access to all Java resources), one language to learn across client and server, etc.
Ruby
  • The more details I read about it the more I think it's an OK but not great language. Its liberal accomodation of so many different syntaxes for the same semantics introduces inconsistencies everywhere. Many design choices are less than optimal (:symbol, Class::classVariable, @_privateInstanceVariable, etc.).
  • JavaScript, in comparison, is much more concise and consistent and yet as powerful at least. It is very easy to do FP (functional programming), OOP and AOP in JavaScript, not to mention it is available on every computer of the world (through the browser).
I think the current enthusiasm behind Rails is more of a vote against the complex state of the art of doing application development using Java, which Spring and Cornerstone 2.0 alleviate to some degree. Since Spring and Cornerstone 2.0 cannot go far enough with hands tied up by Java, people naturally gravitate towards the best current solution of Rails.

BTW, in a short review of Cornerstone 2.0, I was amazed at how many features are there because of Java's lack of dynamic nature, which can be removed completely when we switch to JavaScript. For example, we will completely do away with properties files. Configuration will be done in JavaScript assignments (Emad, remember you were advocating a language for configuration? Now you get JavaScript!). Registry will be just JavaScript source code living on different planes. The more I think about Cornerstone on JavaScript, the more excited I get. I hope to get down to work on it very soon!