This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rommel Sharma
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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!

 
Kenneth A. Kousen
gunslinger & author
Ranch Hand
Posts: 100
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 18
  • Mark post as helpful
  • send pies
  • 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.


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
Ranch Hand
Posts: 100
5
  • Mark post as helpful
  • send pies
  • 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.
 
tomas lin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
Ranch Hand
Posts: 100
5
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic