~clay

merely my musings

Ruby, why do you torment me?

with 2 comments

I want to like Ruby, I really do. The language is expressive, powerful, and eminently readable. Moreover, it’s fun to write. But try as I might to be productive, I keep running into quirks and gotchas with Ruby libraries that make we wish I was using a language with a more mature standard library. Things that take five minutes in Perl or Python have taken me all day to get working in Ruby.

SOAP support, which ought to be fully baked in Ruby by now, is still somewhat painful to work with. In Perl, SOAP just works. When I wrote our release orchestration tool a year ago, it took way longer than it should have to get Ruby talking to the SOAP iControl interface on our BigIP load balancers. By contrast, it took all of five minutes to get the Perl sample working — and that includes time spent installing the SOAP::Lite CPAN module.

Using Rails for the first time in a recent project, I was immediately struck by how little work is required to get a web app off the ground. I almost felt guilty for writing so little code. But a lot of the clever Rails magic that’s supposed to make life easier, didn’t. While error messages like, “Expected foo.rb to define Foo” seem pretty straight-forward, they are maddening when foo.rb does indeed define Foo. For their next trick, the Rails developers ought to use their meta-programming fu to produce intelligible error messages! :)

We recently ported a Rails app to JRuby, and straight away we ran into bugs. JRuby couldn’t call Java correctly, and it had a file descriptor leak in Net::SSH that caused the site crawler component of our application to go belly-up after a few hours. And we should have known better than to try talking to Oracle from JRuby on Rails. The activerecord-jdbc-adapter component had myriad issues — goofy things like "uninitialized constant ActiveRecord::VERSION", improper column name quoting, and incorrect integer datatype coercions. Finally we gave up and ported the database to MySQL.

I understand that Ruby and its libraries are open-source efforts written mostly by unpaid enthusiasts, so I try not to get too upset when things don’t work correctly. I wish I had the time to jump in and submit patches to fix issues when I run into them.

Written by clay

May 3rd, 2009 at 10:39 am

Posted in Engineering, Geek

Tagged with

2 Responses to 'Ruby, why do you torment me?'

Subscribe to comments with RSS or TrackBack to 'Ruby, why do you torment me?'.

  1. Alas!

    Jonathan Aquino

    3 May 09 at 6:41 pm

  2. Same. One of the ways we’ve dealt with similar issues when building our environment management systems in Ruby is to use externals with more maturity. We built the logic in Ruby and picked the externals that we liked best for making calls to SOAP, JDBC, XMLRPC, etc., with a Ruby based abstraction layer in between. Not ideal if you want to be pure Ruby, but we figure that over time as Ruby develops, we can just plug Ruby based versions in as needed or wanted, and shouldn’t have to change the abstraction layer much, since it’s designed around the protos, not the implementations. We figure this will let us do more obscure stuff more easily, too, like talk to proprietary embedded systems. Good times.

    Brian Merritt

    21 Jul 09 at 2:11 pm

Leave a Reply