Sunday, March 12, 2006

Dating Ruby. And Mom, I think it's serious this time

I finally got around to downloading the December meeting of the Chicago Snakes and Rubies. DHH gave a presentation where he talked about his "pursuit of beauty" within Ruby and the Rails framework, and starts his talk with a quote from the physicist Richard Feynman which is worth repeating:

"You can recognize truth by its beauty and simplicity.
When you get it right, it is obvious that it is right."

-- Richard Feynman, Scientist


It got me to thinking about BEAUTY, along with my somewhat jaded dating history with certain programming languages which should go unnamed. OK, why not kiss and tell: Basic (H.S.), Pascal (University), C++ and Perl (Adobe), Java, Visual Basic and C# (IDX/GE) - in that order. I can't but help wondering now if I'd only gotten to know Ruby better earlier, how much heartbreak and mental anguish could I have avoided?

But I guess you can't expect your first love to be the one true love of your life, like in the fairy tales. You've got to put yourself out there, mingle a bit, kiss a few frogs, test the waters, have some blowout fights, win some and lose some to know what's possible. After all, how many seasons did it take for David Addison and Maddie Hayes to finally hook up? Love is HARD.

I suppose there is some truth to the old saw that what doesn't kill us makes us stronger. But I can't help wishing I could at least get back some of the last 11 years and spend a bit of it with that mysterious beauty from the Pacific Rim, Ruby. We had a brief flirtation in the late 90's. Nothing serious. Passing ships in the night really. We met at a speed dating event. We had scheduling conflicts and then we lost each other's cell number. Bad timing, I guess.

At the time I was distracted and fairly into Perl. She wasn't my first, but she taught me a lot. While there were things I really dug about her (regular expression handling, reporting, file operations), she just never fit well with my mental makeup. Not very objective and way too religious: all that "bless"-ed sillyness. (To Ruby, everyone is a child of God.)

I don't want to seem shallow here, but I'm sorry, forget beauty even with a small "b." She was far from a looker. I think was primarily attracted to her nimble efficiency and subtle - dare I say Vulcan - intellect. But half the time I had to get her to repeat herself six ways to Sunday to finally get what she was trying to tell me. No universal translator for us, no "my mind to your mind, my thoughts to your thoughts." And sooo indecisive. Trust me, the last creature in this or any other galaxy you want to date is a wishy-washy Vulcan.

So, when I later met Python, that alluring snake in the grass, in a local dive bar, I found and immediate appeal in her strict constraints and draconian philosophies. Unlike Perl, Py was a no-nonsense dominatrix who laid down the law, smooth black leather whip in one hand, ostrich feather in the other. And man, did you like it. You couldn't get enough. When it hurt, it hurt GOOD. And she always left you wanting more, more, MORE!

But then, I abruptly ended it. She struck me as a tad bossy and, frankly, a bit castrating. Always insisting I do things her way, crossing all my t's, etc. I admit that maybe my male ego got in the way. And perhaps it was also a style thing. No one's fault. But I had needed a bit more freedom. Nevertheless, we still talk. In the end, I think we might make good platonic friends, the kind you call up at the end of a rough day for a little perspective.

But after my brief affair with Py things went seriously down hill for me. You see, over the past five years I've been seeing a lot of Java and C#. I met both of them at work after a painful re-org, which makes me think I was probably on the rebound. Licking my wounds, I suppose I wanted more stability, a sure thing. As if.

I found them both compelling for many reasons. Like a lot of my friends and coworkers, I got sucked in by their sexy promises. And what a HUGE network of friends and family. And I confess I'd never been asked to participate in a threesome. So what red-blooded guy is gonna say no to that? (Though it did bug me how afterwards they were always comparing each other's performance in bed, ad nauseum).

But when you get right down to it there never has been much physical attraction there. Very little chemistry between us. Just going through the motions, really. Nothing like the blood-rushing zing I had with Py, or even the "ahas" from my long conversations with Perl. Anyway, it's probably a bad idea to date two of your coworkers. Better to meet at an out-of-town bar or in an AOL chatroom.

OK, here's the truth. They're really not that hot after you spend much time with them. I'm just not that into them. They just aren't that beautiful to me.

Case in point...

What better way to "compare" them to Ruby than with Java's Comparator/Comparable, C#'s IComparable, and Ruby's sort_by for Enumerable implementations for sorting. (How "meta" is that?).

I won't clutter up this already long post with the Java and C# ugliness (there are fine examples in the previous links), but here is Ruby's terse, elegant, and BEAUTIFUL solution:

class Person       
attr_accessor :first_name, :last_name
def initialize(first_name, last_name)
@first_name = first_name
@last_name = last_name
end
end

people = [ Person.new("Andy", "Hunt"),
Person.new("David Heinemeier", "Hansson"),
Person.new("Dave", "Thomas"),
Person.new("Yukihiro", "Matsumoto") ]

sorted = people.sort_by {|person| [person.last_name,
person.first_name] }
sorted.each { |person| puts "#{person.first_name} #{person.last_name}" }

==>

David Heinemeier Hansson
Andy Hunt
Yukihiro Matsumoto
Dave Thomas

I think it's not surprising who I'd rather take home with me from this party. Assuming I haven't had too much to drink.

This is of course, just one example, but I think it is representive of the differences in their expressiveness. And it illustrates the BEAUTY of some of Ruby's concepts like blocks and closures that are available to other dynamic ladies like Lisp, Python, and Smalltalk.

Now I find my heart pining for what I've been missing, the dynamic nature of some of my earlier loves.

So last year, I took a leap. Tracked down Ruby again (thanks Google!). Apparently she was still available, hadn't settled down one bit (no 2.3 kids, Chrysler mini-van, and surburban cell for her). She has an even bigger network of friends (and lovers), is doing some really amazing things with this Danish guy, and is as open to the world as ever.

Here's my thinking. I figure that I dump Java and C# for a fulltime relationship with Ruby ("Sorry, girls. But it's you - not me - this time."). I increase my happiness by an order of magnitude of 10 (at least!) and I'll be 10 billion times more productive. I should make up for those lost 11 years in no time flat.

Of course, this will mean some major changes in my life. A lot of work and risk. But maybe that's the price of true love. It'll be worth it all if, at the end of each night, on the long walk home from the date, I can look up into the night sky and get that same oceanic feeling I had so many years ago. That life is good, beauty is all around me, and I can once again kiss the stars.

2 Comments:

Anonymous Anonymous said...

raichu: hilarious! more like obie fernandez' (http://www.jroller.com/page/obie?entry=changing_lovers_metaphorically_speaking_of). reminds me of this girl i dated back in college; her name's ruby and she was a marvelous dancer.

1:43 PM  
Anonymous Anonymous said...

It's a small strange world.

I was an allconsuming user long ago and was disappointed when it went away. I discovered today that it was back while I was perusing 43 things.

The first thing I wanted to do was add it back to my blog instead of the system I had created. While doing this I noticed that you had read Confessions of an Economic Hit Man so I go to your blog and see that your latest post was about allconsuming.

Anyway, the book made you think, no?

3:21 PM  

Post a Comment

<< Home