What Ruby has to offer

I wrote an article about considering Groovy over Ruby/JRuby recently and I got a couple of replies. What surprised me is one reply indicating that I should “include a Ruby equvialent of my code” and that some will want “what Ruby has to offer”. I started to wonder, what does Ruby have to offer that I can’t get from or plug into my JVM? It’s an honest question, because I don’t know Ruby that well and I can’t make an informed comparison between Ruby and other scripting languages available for the JVM such as Javascript, Python, and Groovy. I admit that I am a bit biased towards Groovy. (Ok, maybe it’s a bit more than just a bit biased. Maybe it’s a few bits more, maybe it’s a byte more, whatever.) I have good reason for my bias.

Long story ensues…
About a year or two ago I began looking deeper into scripting languages for the JVM. At the time I had grown quite comfortable with Beanshell but there were a few languages that I was hearing about (if you can count the consumption of text through my optical nerve as an alternate form of “hearing”) and wanting to experiment further with. One in particular was Groovy which was in beta at the time. I checked out the site and got all hyped up because it looked loaded with features. I then read a few blog entries about the language and the new JSR that formed around it. It was undergoing dramatic changes back then so I decided to stay away until it got a little more formalized. Some time later I started reading up on Ruby. I was looking at the site with the little fox cartoons and reading about how it promised to be the next generation language and so I felt I would give it a try. From the beginning the syntax intimidated me. I’m not one to shy away from learning a new syntax especially when it makes sense but I was also feeling lost. There were new concepts being thrown at me. Things such as closures, prgmas and the like. I was green to the ideas so it went over my head. I put it away and went back to Java.

Long story continues…
I revisited Ruby again and again over the next year or so trying to get comfortable with it. my last attempt was with the Rails framework after hearing how you could whip up a DB driven app in minutes. My attempts were hampered (is that the right word? wait a minute, Thesaurus check… hinder, retard, impede, delay, block, clog… retard is the word! my attempts were retarded!) by the authenticating HTTP proxy we have in our office. After some tweaking and fiddling I figured out that I just couldn’t get Gem to behave I wanted it to. I asked about the discussion forums and was told to just download all the packages with my browser as a workaround. I felt that was an unacceptable answer and gave up on it entirely.

I then went back to the Groovy project still looking for an alternative CLI to my favoured Beanshell. What I found was the same plethora of features complimented with a JSR-05 release. The dust had settled and stability was promised. I also had a pleasant off-list experience requesting help from the project’s lead. Since then I’ve been beating the Groovy drum and steadily trying to keep up with all the nice stuff they seem to put in each hour. Honestly, it seems like these guys put a new feature in or fix a new bug on every tick of the clock. I’ve never seen a project move so fast or mature so rapidly. I tried out Grails back on it’s .8 pre-release and it worked solid, just like in the docs. I had no proxy issues and everthing behaved a promised in the grails docs. Grails gave me everything that Rails promised me. (Admittedly I did stumble trying to get AJax working at the time.) Since then I’ve never looked back.

Well now I look back and wonder why myself or any other Java developer would want to learn Ruby. Don’t take this harshly. I don’t want to write off a technology based on one or two bad experiences that were likely due to my misunderstanding things in the first place. I am generally curious. Is there something in the Ruby project that can’t be had or achieved using Java technologies? That’s a loaded and confusing question. I blur a couple of lines with it. There are two things in question here actually. There’s Ruby the platform with offerings like Rails, Rake, and more. Then there’s Ruby the syntax with features such as operator overloading, closures, duck typing, dynamic method dispatching, meta programming and more. The syntax can be used on the JVM while various platform offerings such as Rails, Raven, Rake, have been shown to work with Java development. My question is whether or not I need the platform. More specifically, is there something (feature, 3rd part toy, widget, etc.) in the Ruby platform that doesn’t exist in the Java platform? Also I’d like to know if there’s something so magic in the syntax that every other syntax seems to omit?

Since I don’t get much traffic here I’ll resort to investigating and answering my own question. If you do have an answer, though, you know what to do. Drop it like it’s hot in the section beneath the plot…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s