ROBERT SZYMCZAK

in the groove with Groovy...

  • Increase font size
  • Default font size
  • Decrease font size

Why Groovy and Grails?

Why do I choose Groovy and Grails over Ruby on Rails? It is not an easy question to answer considering the fact that the two languages and web frameworks are very similar in that they both attempt to help a programmer accomplish basic tasks in practically no time. Anyway, I will try to provide an answer while reasoning my decision in a fairly concise manner.

Besides having a small (if any at all) learning curve for any Java developer, Groovy has a nice easy-to-read-and-maintain syntax that is familiar to Java developers yet more powerful and dynamic that can be run on the JVM. I know that JRuby, a Java implementation of Ruby, can be run on the JVM as well. But as Guillaume Laforge, Groovy Project Manager, once said, if you develop in Java, use Groovy and if you have Ruby developers in shop go with JRuby instead (Guillaume Laforge on Groovy and DSLs). Using Groovy in a Java shop justifies the fact that it seamlessly integrates with all Java APIs and its object model. In addition, Grails, which is based on Groovy, increases developer productivity by using Convention over Configuration (CoC) and Don't Repeat Yourself (DRY) programming paradigms. And again, yes exactly like Rails does, but on the rock-solid, proven and scalable Spring and Hibernate platforms. But best of all, and this is what I like most about Groovy, it compiles straight to Java bytecode so it can be used anywhere Java can be used. So, the answer lies mainly in my preferences and/or requirements to develop in Groovy instead of Ruby rather than in the actual differences between the two languages.

After all, writing code to solve problems efficiently while having lots of fun is my way to go. The following quote by Brian Kernighan (pronounced Kernihan, with the silent 'g') speaks for itself and... is my all-time favorite: "Do what you think is interesting, do something that you think is fun and worthwhile, because otherwise you won't do it well anyway" ("An Interview with Brian Kernighan" by Mihai Budiu, July 2000).