Skip navigation.
Home

Should I learn Ruby?

Vishu and I were talking the other day, and he expressed an interest in learning Ruby.. in particular Ruby On Rails. I was sort of ambiguous about the exercise but couldn't really put my finger on why. After reading Why Ruby Shouldn’t Be Your Next Programming Language (Maybe), I figured out why I'm not all that jazzed about it.

For me, Java pretty much does whatever I need.. it works in numerous environments and on multiple platforms without that much effort. It lets me decompose a problem and solve it in an OO way quickly and effectively. I learned from the article, that "There are two major camps of programming language syntax: ALGOL and LISP." Java, perl, C, etc all belong to the Algol camp. In fact, most of the languages that I can read but not write-from-scratch are in that camp. Ruby also appears to be in the Algol camp. So for me it isn't really anything new. It is much the same way I feel about AJAX. Why is it such a big deal (from a programmer's point of view) to use javascript to make a bunch of mini requests to a server instead of a single request which refreshes the entire page? It just isn't that big of a deal. The point is that I cannot see why I would learn another language just to accomplish the same (boring) stuff in a very similiar way; I don't see the benefit.

The type of things that get me excited are the things that expand my mind or make me see something differently. I dig puzzle books, IQ tests and watching my children figure stuff out for the first time. The LISP style languages look foreign and difficult to me right now, which means I should probably check one of them out.. Ultimately, I'm sure I won't be all that impressed.. I mean they are just programming languages afterall.. Sticking out tongue

Time Savings

"The point is that I cannot see why I would learn another language just to accomplish the same (boring) stuff in a very similiar way."

It's about the framework: C# and Ruby may both be in the Algol camp, but I could write a web storefront (w/SQL backend) in Ruby on Rails in a 10% of the time that I could do it on .NET with C#, and without writing any SQL queries. The code I write in these two cases is not similar at all, despite that they are both Algol-based languages. Most of my past experience has been Win32 apps so I never ramped up on Java web dev, so I can't compare w/ Java environments.

Ruby still worth it

I understand where you and the article are coming from, but it's a little corse grained to split the world into Algol and Lisp. Lisp is more different from Java than ruby, and ruby is pretty readable for a java person, but it does have some fundamental differences. For example, since it's a weakly-typed scripting language it supports metaprogramming that makes it possible to dynamically do things that would require a code-generation framework in Java. For example, to create an attribute on a class, you add the code:   attr_accessor 'my_attribute' which is actually a method call that dynamically creates the getter, setter and instance variable. But, as Jason says, it's Rails that makes Ruby really worth learning. I dabbled with Ruby about a year ago but never got serious about it before. Adding properties to a "Bean" is no big deal, but Rails takes this to the next level, dynamically adding all the boiler plate stuff that wastes your time with other frameworks. And you simply could not do this in Java. Additionally, Rails has a number of divergences from Spring, Struts and the other app frameworks I've use in Java that make it interesting as a framework independent of the language it's written in. For example, using convention over configuration is a sweet little shift that makes your app just fit together. There's more than that too, but I'm too much of a noob to do it justice. I am really just getting started, so the jury's still out. But so far it's pretty fun. Honestly, I would still be a little scared developing applications as big as the ones we've done in a scripting language; changing an API and not finding out something's affected until it runs is too daunting for me. My parting shot would be that you could have made this same arguement 8 years ago to justify not learning Java if you already knew C++ and you'd have missed out on a lot of new ways of thinking about applications that are more than just the language.

Matt Fleming's picture

Your point is valid..

I am not saying that learning Ruby would be a totally fruitless effort. However, it just doesn't feel like Ruby is different/interesting enough for me to really get that much out of learning it.