• Home
  • About
  • Interview with Dierk Koenig – Author of Groovy in Action

    Early this week I pestered Dierk Koenig into letting me ask him a few questions about Groovy past and present and the upcoming release of Groovy in Action 2nd Edition. If you aren’t aware already, Dierk is the author of Groovy in Action, a Canoo Fellow, and a Groovy, Grails and GPars committer.

    Hamlet: The original Groovy in Action was published almost 4 years ago using (I believe) Groovy 1.0, and the 2nd Edition of the book is scheduled next year to coincide with the 1.8 release. What are the biggest productivity improvements between Groovy today and that of 4 years ago?

    Dierk: Well, there are so many cool developments that I hardly now where to start, and in the end I will probably end up forgetting the most important one. Anyway, I will try.

    One of the most important features is backward compatibility. I think the Groovy team has done a very good job in advancing the language without introducing breaking changes.

    For me, it is often the small changes that make a big difference like “power assert“. A newcomer may dismiss this as a minor thing but it is of ubiquitous use, beside showing the language power of Groovy. I could mention many more improvements: the completion of the GDK, Mixins, more Metaprogramming options, command expressions, the Grape packaging system, and so on, but two features make the biggest difference in productivity for me: AST Transformations and IDE support.

    AST Transformations use annotations to demarcate classes, methods, properties, and the likes in order to
    achieve an enriched compilation. You want your class to be immutable? Simply give it the @Immutable annotation and you have all the goodness. There are endless possibilities with this approach and it comes without runtime costs!

    IDE support has evolved far beyond what I ever thought possible for a dynamic language. Code completion for dynamically added methods? Yes, that’s possible! And even though the Groovy compiler has no need for type inference, the IDEs can give code completion on inferred types. Cross-language refactoring? Done. And the list goes on…

    Hamlet: In 2007 Groovy won the JAX Innovation award. Is Groovy still a leader in JVM innovation?

    Dierk: Looking into the roadmap for Java 7 and 8, it is pretty obvious that many developers have fallen in love with Groovy features and this forces Java to provide equivalents for at least a subset. Groovy has become and still is a pioneer for Java language features, simply because we strive for language features that make us more productive while keeping the solution Java-friendly.

    Hamlet: James Gosling wrote a famous paper called “The Feel of Java” in which he described Java not in terms of language features but in terms of a general mindset and philosophy. You’ve been involved with Groovy since almost the beginning. What is the “Feel of Groovy” and has it changed in the 7 years the language has been alive?

    Dierk: There are two sides to this: the user view and the developer view.

    As a user of the Groovy language, I would say that Groovy still feels as groovy as in the early days. The important points are:
    - Groovy is dynamic (that’s the nature)
    - Groovy is feature-rich (that’s where the fun comes from)
    - Groovy is Java-friendly (hence easy to use)
    Groovy always was and still is a “getting things done” language. It is pragmatic – as opposed to being dogmatic about language design theory.

    For a developer, the feel of Groovy has changed. The early days were a bit of a wild-west but since version 1.0 (and not coincidentally the release of Groovy in Action) we feel a high obligation to evolve the language in a controlled fashion. In my perception, Groovy has become the de-facto industry standard for dynamic programming on the JVM and many projects and organisations rely on it.

    Hamlet: Lastly, I see that readers can already download parts of Groovy in Action 2nd Edition from Manning’s MEAP program. Is the MEAP complete enough to be useful today or Groovy newcomers stick to reading the 1st edition for now?

    Dierk: The first edition is still fully valid and for the sake of completeness I would advice newcomers to go with it. You can always buy the second edition later. Honestly, computer books are ridiculously cheap, especially if you compare it against the price-tag for the invested reading time (not even mentioning the invested writing time).

    Hamlet: Thanks Dierk!

    Dierk: My pleasure!

    You can catch Dierk at the upcoming W-JAX conference this November in Münich. He will talk about parallel processing with Groovy, advantages and limitations of dynamic programming as well as about the Canoo RIA Suite.

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • Y!GG
    • Webnews
    • Digg
    • del.icio.us
    • DotNetKicks
    • Facebook
    • Google Bookmarks
    • Newsrider
    • Newstube
    • TwitThis
    • YahooBuzz

    8 Comments

    1. Cryptos said,

      November 3, 2010 @ 6:12 pm

      The main innovator in the field of JVM languages is Scala. It is conceptually much clearer and more powerful than Groovy. Something like @Immutable is not needed in Scala, since the language provided all you need to create immutable objects.

    2. Rene said,

      November 3, 2010 @ 6:20 pm

      as far as I know, when buying GIA II via MEAP you even get an free GIA I as ebook!

      regards,
      René

    3. Tomas Lin said,

      November 3, 2010 @ 6:49 pm

      Worth pointing out that if you buy a copy of the 2nd edition in MEAP, you get a free copy of the full text of the first. So you don’t really have to choose. — http://www.manning.com/koenig2/

    4. Tomas Lin said,

      November 3, 2010 @ 6:50 pm

      Worth pointing out that if you buy a copy of the 2nd edition in MEAP, you get a free copy of the full text of the first. So you don\’t really have to choose. — http://www.manning.com/koenig2/

    5. Hamlet said,

      November 3, 2010 @ 8:39 pm

      @Cryptos I think there are way, way too many languages on the JVM to say that any one language is the main innovator. Scala certainly has some good ideas, as does clojure, jruby, scala, fandom, etc, etc. What I (and Dierk) think is cool about Groovy is that with AST Transforms the @Immutable can be written as a user library. It happens to be shipped with Groovy today, but this could as well have been written as a separate project. This is the opposite of having something cool part of the language… it is having an extensible language where the coolness is created by users. Spock and GContracts are great examples.

    6. paulk_asert said,

      November 3, 2010 @ 11:10 pm

      @Cryptos, I also think the term *more powerful* depends on the context. There is obviously no program that can be written in Scala that can’t be written in Groovy. So, we are talking about style and ease of developing, composing and using abstractions. Sometimes a rich static type system assists with these goals, sometimes dynamic typing assists much more. The thing I like about Groovy is the ability to have a richer type system than Java (e.g. look at the Goovy++ plugin) or use its dynamic nature when that makes sense.

    7. paulk_asert said,

      November 3, 2010 @ 11:10 pm

      @Cryptos, I also think the term *more powerful* depends on the context. There is obviously no program that can be written in Scala that can\’t be written in Groovy. So, we are talking about style and ease of developing, composing and using abstractions. Sometimes a rich static type system assists with these goals, sometimes dynamic typing assists much more. The thing I like about Groovy is the ability to have a richer type system than Java (e.g. look at the Goovy++ plugin) or use its dynamic nature when that makes sense.

    8. anehra63 said,

      November 9, 2010 @ 11:47 am

      An excellent interview.

    RSS feed for comments on this post