Groovy and Grails: Three Worries

Yesterday I blogged ten pleasant surprises with Groovy and Grails. Let me reiterate that overall, I am impressed. But there are a still a few issues that make JRuby a more promising alternative at present.

  1. Groovy classes are not open. I understand the reasons for this decision, but I want the productivity boost possible in a language where this is legal:
      class Person { 
        def firstName; 
      }
      p = new Person();
      class Person {
        def lastName;
      }
      p.lastName = 'Halloway'
    My example here is trivial, but the concept isn't. For more on both sides see here and here.
  2. Grails is not written in Groovy! (For the most part.) I went looking for the implementation of the chain method, and it was a whole Java class to itself. I am hoping that the Java bias is legacy, and that the Grails team is now more comfortable eating Groovy dog food.
  3. The "optional static typing" argument is a red herring, until somebody produces some compelling examples. Groovy advocates point out that they have the best of both worlds--dynamic typing with static typing available on request where needed. This sounds good, and it may be good, but show me some significant examples. Better yet, articulate some rules of thumb for when to use dynamic typing, and when to use static typing, within a single Groovy project. This is a serious request, not flamebait. Instead of debating "static typing--yes or no?", let's debate "static typing--when?" in a language with a clean syntax for both.
Get In Touch