Martin Fowler on his bliki (part blog, part wiki) has a new entry about the ongoing debate about using Groovy or JRuby on the Java VM. I really don’t have a problem with anything he wrote there. I agree that both languages are interesting and worth developers getting to know and that Ruby probably has the edge on where things are going in the future. But one of the largest driving factors as to why a development team might choose either Groovy or JRuby wasn’t covered at all. So with apologies to both Martin Fowler and Ronald Reagan (not that I think he’s particularly upset with my hijacking of one of his more famous lines) I’d like to make my small addition.
My Dad’s dad was a blue-collar, regular joe who worked as a boilermaker for more years than I’ve been alive. He also grew up in a very large, very poor family in Louisiana during the 1920’s and 30’s. He was very much a no nonsense kind of guy. As I grew up he would often say comments or sayings that on the surface seemed pretty basic and simple but as you thought about them you started to see how complex and deep they really were. I also noticed that the sayings would be more clever the more cans of beer that were missing from his case. Anyway, one of my favorites was “Son, if you want to move a train, you back up the engine to it…and pull.” Yeah, no kidding. Thanks grandpa.
The heart (and the clever part) of that saying is what is missing from Martin Fowler’s entry. Go ahead and take into account all of the things he lists on the page but also add in the costs of overcoming the peopleware issues of trying to pull your organization in a new direction. There are a lot of developers out there that aren’t very skilled. These poor lost souls barely understand idiomatic Java after years of working on Java-related projects. You are not going to move an organization of these folks by throwing down the gauntlet and simply willing them to move. You are going to have to take the active roll of backing up your engine to pull their massive weight.
Groovy is a nice way to get Java developers - skilled or not - exposed to some of the ideas and idioms that scripting languages bring to the table without leaving the safety of Java (the language). It isn’t an all or nothing deal with Groovy like it is with Ruby/JRuby. You can take your time acclimating developers to the new world instead of simply throwing them into the deep end and hope they swim. It is just like you wouldn’t back up a train engine, attach the cars, and then try to floor it to get the whole thing moving.
JRuby on the other hand appears to be focused on getting Ruby developers a foothold into the JVM. I’m not saying JRuby doesn’t bring anything to the table for a entrenched team of Java developers I’m just saying the overhead of doing so is higher than Groovy since you can’t fall back to a more Java-like idiom if you need to. But if you have the development staff that can just jump in and go all out by all means do so.
So, take Mr. Fowler’s advice about Groovy and JRuby but don’t forget to think about how you’re going to back up to the train.
Tim Goeke responded on 07 Dec 2007 at 3:31 pm #
Doesn’t the argument also revolve around tooling as well? If you are a IDEA shop, it looks like Groovy is the way to go, but if you’re a Netbeans shop, then maybe JRuby fits better.
I don’t know about Eclipse - it seems that the Ruby support in entirely Aptana and the Groovy support is still developing, although I have not tried it personnally.
I am mainly an Eclipse user but Netbeans has my attention at least for JRuby tinkering.
In general I feel more interested in JRuby than Groovy but I am tinkering with both. Can’t you do both things? Is the choice really Java vs Groovy vs Ruby? Why can’t you do Java + Groovy + Ruby?
Why are people threatened when others compare? Finally, can’t I fall back to a java idiom in either JRuby or Groovy? What’s the real difference?
Chris responded on 07 Dec 2007 at 5:30 pm #
Absolutely the argument is more general than simply Groovy vs. JRuby. The extension of the idea to IDEs, build tools, frameworks all seem to apply equally well. And you, as a single developer, certainly can do both things with your free time or your projects. I was thinking in the general sense of an organization and the need to choose a direction when developing software for it. Typically, an organization isn’t going to take a ad hoc approach to the tool sets and technologies it uses to develop its internal software.
I also find (J)Ruby much more interesting than Groovy and my intent wasn’t to compare the two languages but instead add another thought point to the discussion when having to choose between them. In my current work attempting to sell (J)Ruby would be a non-starter. Management there seriously believes Java as a whole has only been enterprise ready in the past 2-3 years. lol
Eclipse’s Groovy plug-in, while nice, currently lags behind the latest Groovy code (as I recall the plug-in is based on 1.0.1 while the current Groovy version is about to be 1.5). I have played with NetBeans and the (J)Ruby/Rails support in it is indeed outstanding.
Thanks for being the first to comment - ever.
x responded on 07 Dec 2007 at 6:30 pm #
I think “unskilled” developers will have a better chance with Groovy than with Java 7.
Chris responded on 08 Dec 2007 at 8:56 am #
LOL With things like closures and multiple return types being kicked around I think you’re right.
Maurizio responded on 09 Dec 2007 at 4:18 pm #
Interesting article. Most of the customers I know and the company I visit are still running big chunks of their business with cobol over mainframes, some are still moving to Java 1.4 and J2EE and it’s hard to convince them about Java 1.5 (well, the only real interesting things are annotations, but only within the new JEE 5 context). They don’t even know what Ruby or Groovy are and management would laugh at me if I only would think to tell them about evaluating a new, open-source scripting language after they have been told for years to buy very expensive EJB containers (it was not me, anyway).
Enterprise are conservative about IT spending and often they are right. We have spent the last years convincing them on how cool was to move to a J2EE app server, wasting then a lot of money with the broken EJB 2.x programming model (again, it was not me). Now, we all know that would be much better to move straight to a simpler development environment, made of scripting languages, lightweight frameworks like Spring and even EJB 3.0, but most customers had their fingers burnt so it is very hard to gain their confidence again.
I have a lot of respect and admiration for Martin Fowler, but some of these languages debates are purely academic. Ruby is very interesting but its syntax is too new and exotic for most of the average programmers. Additionally, I have never seen a context were the language itself was the source of problems or the solution to them. Projects fail mainly when people do not cooperate and communicate, technology doesn’t usually matter, unless it is really broken (examples, anyone?).
+1 to Groovy, anyway.
Chris responded on 10 Dec 2007 at 8:04 am #
I’m in the exact same situation you are in so I feel your pain. I guess we are a little father along since we are using Java 5 across the board but other than that it is the same attitude. I’ve sat in presentation here where people (who should have known better) said that Acegi (i.e. Spring Security) was for monitoring your apps and that we’d have to buy coping of Spring and Hibernate. lol While I couldn’t sell (J)Ruby I might be able to push across the idea of Groovy simply because I can ease developers who have worked here for years and thing Java is a “fad” into it.
Excellent points in your comment Maurizio!