Friday, November 18, 2005

Rolling on with Ruby along Others

Ruby, the most talked about language in the recent times. What does it offer? I do tried out ruby. It has most of its syntax borrowed for PERL, only the good things form Perl. Handling with data in hashes, is the most toughest thing I tried with Perl, de-referencing and accessing the data types make me sick.

The reason why we come out of main stream language, and try out things in a scripting language is the rapid development times that it offers, the pre-built libraries it offers. The things which we develop in these scripting language are mostly effective tools, which aids in out work. Say in Perl, I tried out to write a script that performs, load test of an web application. All I have to do, is search for pre-built exhaustive libraries (posted by developers around the world), and use them to built it the script that virtually performs a click on a web page, and captures the result, matches with successful response, records the time taken. If have done the same in Java/C++ then the application may be extensible, generic, but it would have taken more time, which costs more than what we can afford for that task.

Python, a nearly same language as like Ruby, boasted as alternative to Perl some years ago. I have no experience with Python, so cant comment more on it. But what I see with Ruby is ease with which can build tools/applications. We should compare only it with similar languages like Perl, groovy, python. Don't compare it with Java, because in mean terms it would see like that Ruby positions itself better, but Java gives huge options to developer, if properly chosen the options, then that project would be success. The problem is more with not choosing right option. The kind of options/flexibility Java offers is required for any project which sees itself for re-use/longer life-cycle. Maintenance/extension would be easier in Java, remember only if properly designed/ used the features pragmatically. But the scripts we write in Perl, are mostly have small life-cycles, the context they serve is smaller. Or to tell in the other way, we write them that way, which solves our current problems, rather focusing on reusability. It is not that we wont be able to design re-usable things with them, but again the time we take to design it such a way, would add up the cost. That overshoots the need of the hour.

Why these much of languages? Take Groovy, Python, Tcl, Perl, Ruby... I feel all these languages fight in a category that they a life-savers boats, not a huge posh ship. Each serve their own purposes. Will Ruby replace java, this is the question that is asked since Ruby on Rails framework has been released. My sincere thoughts are they wont. Ruby eases writing small tools which serves the purpose of the hour, Ruby on Rails may ease development of small web-applications, but not what Java does. Java is like meeting all needs, only u have to choose what u need. Choose a framework suit ur needs, if u don't need EJB, use a alternative for it. Don't choose because it offers. This not true only for choosing the apis/frameworks/technology while building an Java application. It is even true when u decide what language to use, Java/Ruby?

Ruby is a really a great contender for the category of building need of the hour tools/ applications whose context is small. Competitor to Perl/Python.

References:

Dave thomas Interview on Code Genration: talks abt using ruby in code genartion taks.
http://www.codegeneration.net/tiki-read_article.php?articleId=9

Talks abt Context, helpful in understanding about them
http://www.jot.fm/issues/issue_2005_09/column4

Michael Yuan's Java Blog: "Is Ruby Replacing Java? – Not So Fast ...
http://www.enterprisej2me.com/blog/java/?postid=145

No comments:

Recommended Blog Posts