The Accidental Rubyist

invalid byte sequence in UTF-8

Archive for June 2006

Falling in love with ruby

leave a comment »

No, Ruby is not the name of a cute little dachsie next door, i refer to “/usr/local/bin/ruby” a wonderful programming language. After many years of enjoying Java programming, flirting twice with python, (and making a stab at rubyonrails too), I finally sit down with a few ruby tutorials, and find myself having great fun. Yes, ruby is expressive and all that.

However, all isn’t perfect in rubyland. First of all finding documentation. The documentation/tutorial on the official site is quite outdated, and very rudimentary. The python tutorials really get you started in comparison, taking you into file IO, and wow stuff like memory mapping, NIO, pickling and plenty of other stuff I can’t recall. There is no “What’s new in ruby 1.8” on the official site – how odd! – you have to search around to find a blog with some entries – this blog will show you some goodies.

A related issue is that often code actually is documented, but ruby’s documentation system does not show up classes and methods. You have to search through code to find methods. While using rdocs for ActiveRecord, i could not find methods to get a list of tables and columns in a database. Someone pointed out that in the mysql code the methods are there. If so, then why dont they show up in the docs. Similarly, ruby-dbi docs speak of DBI::Row, but the class is missing in the docs, you have to find the code and find out its methods, and they were documented! Is the rdoc system flawed ?
Standardization:  Ruby does not seem to have a standard means of db access in ruby core analogous to JDBC. I appreciate that there are many ways : DBI,  OG, ActiveRecord and  directly using ruby-mysql. However, it almost seems that DBI is an individual effort that is dying (see the entries in the rubyforge site). If not, why is DBI not part of core? A new-comer has to hunt around to find out how to hit the DB, and has to decide which of various softwares to use … download them install them configure them, subscribe to user lists, write to authors to find out details (due to lacking or outdated documentation). It is fine for higher level approaches to remain outside core, but core itself should have a basic way.
The same thing happened with ruby and the web. So many different ways, no standard way. No basic document. has an entry but all the links are blank. I just found this link which has some ruby web programming stuff to get you started. I am told a simple fast way to run your ruby and rails apps is mongrel. More later.


Written by totalrecall

June 12, 2006 at 12:11 pm

Posted in ruby