Tuesday, April 10, 2007

Some Thoughts on Ruby

Ruby on Rails (RoR) seems very promising. However, not every web applications are CRUD applications. It is very easy to have the similar frameworks to implement it in Java or PHP. Even Ruby got the attention now, it will like all buzz diminishing at the end.

Let's see how I reach the conclusion from the successful platform.

Java
  1. Cross-platform
  2. Language of C family
  3. Huge number of libraries
  4. Backed by big corp
  5. Excellent Javadocs API
  6. Nice IDEs
.Net
  1. Support multiple languages
  2. Medium size .Net libraries but able to talk with legacy DLLs
  3. Backed by big corp
  4. Very nice MSDN
  5. Very nice IDE
PHP
  1. Cross-platform
  2. Morph from C family
  3. Large size of libraries
  4. Interactive PHP Manual (i.e. users can add the comments providing examples, tricks, etc)
To make a language/platform success, the language family, the size of libraries, and the documentation are very critical. Perl, for example, does have the whole CPAN libraries and quite well documented. However, the cryptic syntax scares off so many people. That's how PHP became more popular than Perl.

Java and .Net have the advantages because they are backed by big corporations and they have the resource to get the documentation written nicely. PHP does not have the financial advantage but it starts off very simple at the beginning. Documentation can be written and updated bit by bit.

Now, Ruby is not a language belongs to C family. I believe that the size of the libraries cannot be larger than CPAN. The library should be well written. However, it does not have a nice IDE. It does not have big corporation support. It only has a framework letting programmer to get the easy job done. As I mentioned in the first paragraph, the framework can be written in Java/PHP easily. It is not a good advantage. Is it going to success?

Alternatively, I think Java and server-side JavaScript (Rhino engine) can have the synergy. Simply speaking, RoR reads database and generates the data model, the controllers, and the views. Java can read the database (from MySQL to Oracle) to generate the data model and the controllers in JavaScript (for the sake of flexibility) and use a template engine (JSP, Velocity, Freemarker) to generate the view. Since ALL web programmers know JavaScript already, they can REUSE what they have already known. With some simple documentation to let the programmers know how to get the job done, it is very easy to get adopted.

P.S. JavaScript success factors:
  1. Cross-platform
  2. Language of C family
  3. Large size of libraries (esp. after the AJAX boom)
  4. No official documentation but references are just a click away from the search engine