Monday, December 17, 2007

Top 5 reasons why Groovy is the best dynamic language for Java

  1. Offers seamless integration with Java
  2. Groovy generates same bytecode as Java. Once compiled, Groovy classes are nothing but Java classes for the JVM.

  3. Java like syntax with flat learning curve
  4. Groovy has Java like systax. Groovy code is more concise and readable than Java code. It comes with dynamic language features that Java language is lacking. Also brings in scripting capabilities.

  5. Mix and match Groovy and Java classes
  6. A Groovy class can extend a Java class and vice versa. A Java class can implement a Groovy interface and vice versa. Groovy shares same object model, libraries ans same security model as Java.

    JetBrains "joint compiler" eliminates the need for cleverly chosing the order of compilation while mixing groovy and java classes when one extending another or one implementing another and vice versa. It offers compilation of both classes with one go without having to worry about dependencies between both types of classes.

    When compiling from command line through groovyc, just specify -j for joint compilation. For e.g.

    groovyc *.groovy *.java -j -Jsource=1.4 -Jtarget=1.4

    ANT task and Maven plugin is available for groovy project. Maven archetype is also available for rapid bootstraping your project.
  7. Brings in Dynamic language features to Java
  8. Run-time method dispatch is one of the core feature of a dynamic language. It happens at run-time instead of compile-time.

  9. Brings in Fun with Productivity
  10. Groovy is fun and lot more productive to code than Java. Your code can be more precise, expressive and readable than Java code.

No comments:

Post a Comment