watch this  

the official mrchucho blog

I "heart" Ruby

Posted 2005 Feb 01

If you’ve been watching my del.icio.us, you have probably noticed that I have recently become enamored with Ruby. I won’t rehash what Ruby is - as that has been covered extensively elsewhere - but will say that, for me, it seems to strike at that sweet-spot right between Perl and Python.

I’m starting a new data migration project at work. Nothing too technically challenging, mostly translating and moving data around. This is, of course, a perfect task for Perl/Python/Ruby. I have used Perl and Python plenty in the past and saw this as a perfect opportunity to explore Ruby. The Ruby On Rails article at O’Reilly just seemed to confirm it!

My first task was to find and test the database drivers. Thankfully, Ruby (like Python) uses a Perl-style DBI interface. Though the Ruby Oracle modules don’t seem quite as mature as Python’s or Perl’s, they are certainly functional. By adhering to the DBI API, I’m not bound to either one of the Oracle versions, though Ruby/OCI8 is certainly more active than Ruby9i.

Later, I’ll post the side-by-side Ruby, Python, Perl DBI comparison I did before deciding on Ruby. But, in the meantime, I guess what I liked best about Ruby was being able to do stuff like this:
<pre><code>
def save_record(column_one, column_two, column_three)
    # ...
end
dbh.execute("select * from table").each do |row|
    save_record(*row[0..2])
end
</code>
Plus, the Ruby community seems very Mac-friendly! Good Ruby Resources:

Responses to "I "heart" Ruby"

No responses yet.

Comments are now closed.
atom rss