Knowing when to quit
It looks like there is a storm brewing after Charles Nutter posted an interesting piece on making a JRuby "strap-on" for Grails.
Graeme has responded eloquently stating the case for Groovy, the critical point being that we already have a working solution today. Why bother devoting significant resources into the new code to integrate Ruby, all the unit tests, parallel documentation and API compromises to do this?
A fork in the Grails codebase to achieve this would be a big mistake I feel, for several reasons. Forking divides resources. New core features are likely to be added in Groovy using Groovy paradigms, not Ruby. A large part of Grails success is in its dynamic paradigms tailored around Groovy. Documentation, which is a killer requirement for frameworks, would become fragmented and high maintenance if split across multiple languages. I could go on.
Charles says, rather controversially "Grails’ value is not in Groovy". This is partly true however it is hard to see how Ruby would add value to Grails except by allowing Ruby-ites into the Java web-application development space.
Grails gives value far beyond Groovy, but Groovy gives Grails the crucial edge in companies that use Java.
It seems to me that most Ruby/Rails development is for green-field applications, after all who has a legacy Java codebase they can effortlessly plug Ruby into? Even if Grails supported Ruby, you’d still have a new language to learn, and for what?
This is precisely why Groovy is the best choice, and why compromises to Grails powerful dynamic nature using builders etc would be a big mistake to support a language that is much further from the Java used by most people Grails is targetted at.
We have a long-running thread on the Grails user list about us adding support for JSP taglibs to Grails GSP pages. This is not something we are keen to do because there is a lot of work involved to support this legacy code. However it is something we must do to ease adoption of Grails in Java-friendly organisations where JSP is still the norm.
The point here is that this is a relatively minor "join point" in the stack. I think having Ruby as the scripting language for Grails would be very unnattractive to these companies, far more so than not supporting JSP tags.
Grails is seeing huge increases in interest, and the momentum keeps building. I’m due to speak at the first Grails Exchange 2007 conference. It’s a great complement that Charles is indicating that Grails is a solid and productive stack, given its relative immaturity compared to something like Rails which should be a snip to get working on JRuby, considering that a lot of work would be required to add Ruby into the mix.
As all pragmatic programmers like Charles surely know, you should use the best language for the job. How is Groovy deficient for Grails? I can’t think of a single reason. Why use Ruby instead? The only reason I can see is to ease entry by Ruby coders… who already have Rails.
Therefore this question must now come down to "Why is Charles suggesting Ruby coders use Grails instead of Rails?". We have quite a few reasons, not least cleanly leveraging all the great J2EE stack elements, but we’ll leave the rest to the users of both to argue about
As I touched on in my recent interview on the Grails Podcast, I am proud to have learned when to quit when there is already a good solution for the problem.
Early in 2006 I developed my own application framework (the latest in a number of them) using JDBC, Spring and Groovy. It was simple and successful in commercial sites, but required too much maintenance to add new functionality and too much scripting for back end code. At this time Graeme asked me why I wasn’t trying Grails out. I brushed it aside as I didn’t have time to look into it fully, and considered it to be a little immature, which at that time it was for my needs.
I then researched Ruby on Rails a little, and got excited by what was possible with coding by convention. Simply put, I didn’t want to learn another language from scratch, and Groovy was so easy to move into from Java. My dialogue with Graeme continued and I started playing with Grails. Come late 2006 and my new commercial sites beckoned, I didn’t hesitate to use Grails. Grails 0.4 added a lot of polish over previous versions, I like to think due in part to the huge number of issues I raised in JIRA, and made development of the sites painless, and even a joy.
Grails’ time has come.
March 14th, 2007 at 2:46 pm
Hear hear!
Groovy yaaaaayyy! JRuby booooooooo!
Keeping my comment succinct since I already ranted on Graeme’s blog.
March 14th, 2007 at 2:50 pm
Er, I should have added “in the context of Grails”. I’m not slamming JRuby itself as a concept.