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!