aspose file tools*
The moose likes Groovy and the fly likes What can Groovy do better that Java can't or cant do as good as Groovy? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "What can Groovy do better that Java can Watch "What can Groovy do better that Java can New topic
Author

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

Rommel Sharma
Greenhorn

Joined: Oct 31, 2003
Posts: 18
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!

Kenneth A. Kousen
gunslinger & author
Ranch Hand

Joined: Sep 18, 2002
Posts: 89
    
    5
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!


Kenneth A. Kousen, Ph.D. (assorted certs), President, Kousen IT, Inc.
Author of Making Java Groovy - http://www.kousenit.com
Rommel Sharma
Greenhorn

Joined: Oct 31, 2003
Posts: 18
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.


Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

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!


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Kenneth A. Kousen
gunslinger & author
Ranch Hand

Joined: Sep 18, 2002
Posts: 89
    
    5
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.
tomas lin
Greenhorn

Joined: Feb 18, 2010
Posts: 2
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
Ranch Hand

Joined: Sep 18, 2002
Posts: 89
    
    5
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What can Groovy do better that Java can't or cant do as good as Groovy?