• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What can Groovy do better that Java can't or cant do as good as Groovy?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

The subject says it all:

1. What can Groovy do better that Java can't or cant do as good as Groovy?
Some blogs say Groovy is the super set of Java with lots in common - why this need arose?

2. Could any new features that groovy introduces not have been part of java in the upcoming release?

3. Which is the book that I can use as a reference for Groovy - the best you would recommend?

Thanks in advance!

 
gunslinger & author
Posts: 169
16
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rommel,

Rommel Sharma wrote:

Hi All,

The subject says it all:

1. What can Groovy do better that Java can't or cant do as good as Groovy?
Some blogs say Groovy is the super set of Java with lots in common - why this need arose?



Groovy is the evolutionary next step from Java. It's an OO language that simplifies Java in many ways (native collections, operator overloading, Groovy JDK), but also goes beyond what Java can do (closures, builders, metaprogramming). You don't "need" to use Groovy, but when you do use it, you're only adding to your Java knowledge. Groovy makes Java better, more powerful, and easier to use, but integrates with existing Java classes without a problem.

Rommel Sharma wrote:
2. Could any new features that groovy introduces not have been part of java in the upcoming release?



Java 8 includes lambdas, which are like Groovy closures but imply pure functions. Groovy will no doubt evolve to accommodate them. Java 8 still won't have a meta-object protocol, or anything like Groovy's AST transformations, or operator overloading, or the simplified syntax, or any of a wide range of Groovy capabilities.

Again, the question sounds like you're looking for a reason to do what Groovy does, but do it in Java. That's possible in some cases, but not necessary. You can add Groovy to existing Java and use them together.

Rommel Sharma wrote:
3. Which is the book that I can use as a reference for Groovy - the best you would recommend?



My editor would be annoyed with me if I didn't recommend my book, Making Java Groovy. The definitive reference for Groovy, however, is Groovy in Action, whose 2nd edition is current available through the Manning Early Access Program.

Thanks in advance!

 
Rommel Sharma
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks Kenneth for the detailed reply and the information I was looking for.

I look forward to reading 'Making Java Groovy' and/or 'Groovy in Action' to get started.

Took a look at the forum that has the link to the sample chapter from 'Making Java Groovy' and liked the writing style that has lots of examples explaining the difference and the advantages.

http://www.manning-source.com/books/kousen/sample_ch01_MJG.pdf

Thank you again!
Rommel Sharma.


 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kenneth A. Kousen wrote:My editor would be annoyed with me if I didn't recommend my book, Making Java Groovy. The definitive reference for Groovy, however, is Groovy in Action, whose 2nd edition is current available through the Manning Early Access Program.


And I think your publisher would be pleased that you mentioned not one, but two Manning books!
 
Kenneth A. Kousen
gunslinger & author
Posts: 169
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And I didn't even mention Grails in Action, Gradle in Action, or even Griffon in Action, which are all good.

Manning has obviously been very supportive of the Groovy ecosystem. If you're looking at other publishers, APress has The Definitive Guide to Grails 2 by Graeme Rocher and Jeff Brown, O'Reilly has a series on Gradle (Building and Testing with Gradle and the recently released Gradle: Beyond the Basics) and the excellent Programming Grails by Burt Beckwith, which should be everybody's second Grails book. Pragmatic Programmers has Groovy Recipes by Scott Davis, which is a bit dated, and Programming Groovy 2 by Venkat Subramanium, which was recently revised. I believe they're finally going to release a new version of Dave Klein's Grails: A Quick-Start Guide too.

I may be missing a couple, but those are most of the available books in areas related to Groovy.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best Recipe book out there for groovy is the Groovy Goodness Notebook, by Mr. Haki and collected from his blog posts - https://leanpub.com/groovy-goodness-notebook
 
Kenneth A. Kousen
gunslinger & author
Posts: 169
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm glad someone mentioned MrHaki (Hubert A. Klein Ikkink, believe it or not; @mrhaki is his twitter handle) and his "Groovy Goodness" book. He took the bold move of self-publishing. The LeanPub approach took his blog and built a draft version around that, which he then edited. When you buy his book (at https://leanpub.com/groovy-goodness-notebook), you're actually paying him and not the publishing company. That's partly why it's only available as an ebook.

His blog is a great learning resource, and the book is essentially a collection of articles he's written over the years.
 
reply
    Bookmark Topic Watch Topic
  • New Topic