Groovy is turning out to be rally rather interesting.
I remember thinking that I was learning OO back in the 90's and reading GOF patterns Design Patterns book and not really getting the plot. Why did they need Visitors, Observable and Action Listeners. What was it all for?
I understood this later when working with various Java frameworks and was really quit impressed with the GOF's foresight.
Groovy strikes me as this story being repeated. The way that Meta Class Dispatching and Closure can be combined to produce builder is simply brilliant.
The fact that this is all Java compatible and therefore lets you exploit all the huge resource of open source frameworks stikes me as important.
Debugging in Groovy appears problematic though. The stack traces and the error messages are by no means obvious and as we all know, most programmer spend most of their day staring at these trying to understand what they've done wrong or the writers of a library have done wrong.
Open verdict on Groovy as a language yet but Groovy In Action is certainly a decent attempt a explaining and teaching the language/ More later.
We are using Grails at work. I am using this book as a reference, looking up topics as needed and leafing through it to get a general feeling for the language. Groovy is a lot like Ruby, but with a syntax that is much closer to Java.
I was looking up the -p and -n options to write scripts for processing input files, and I was annoyed that there was no exhaustive list of the resources available to my script as it processes lines. The book mentions line, which holds the current line, and count that counts lines read so far, but what else is there? How about the current filename? Or the line number within the current input file? I had to dig through the source code for Groovy to find out that line and count were all that there was.
This is a well-written and fun book by the creator of Groovy that allows one to quickly start working in the language.
Why would one want to learn Groovy? Groovy is an extension to the Java programming language that allows one to write simple scripts that are Perl-like in flavor. Suddenly Java no longer feels like a compiled language. Classes may be mutated on the fly: one can add fields and methods during execution. The code is concise, clean, and intuitive. Groovy includes powerful integration with ant, JDBC, servlets, XML parsers and generators --and so on.
Groovy is a strongly recommended extension to the toolkit of any Java programmer and it is very easy to learn.
On the downside Groovy does not stand alone but feels like an extension to Java. One must be well-versed in Java and understand the Java underpinnings to use the language effectively. I don’t think there will be any Groovy programmers: there will be Java programmers who use Groovy.
The most exciting application of groovy to my mind is the grails web framework. This framework has proven itself production ready and is, I anticipate, the wave of the future.
If you are a programmer who left for management or architecture, this book will bring back your enthusiasm for coding again as it shows how to lever a Groovy, a powerful dynamic language that makes programming enjoyable again. I found myself thinking of experiment tasks that would allow me to apply the scripting aspects of Groovy to get something working quickly.
The following chapters are the highlights of GINA in my opinion - Chapter 5. Working with closures - Chapter 7. Object orientation, Groovy style: pay attention to section 7.3 Advanced object-oriented features particularly the topic on Traits - Chapter 8. Dynamic programming with Groovy - Chapter 11. Working with builders: shows how easy it can be working with XML or JSON in comparison with Java -Chapter 13. Database programming with Groovy - Chapter 17. Unit testing with Groovy - Chapter 19. Domain-specific languages
The Bad: I thought that the first part of the Book (which teaches you the Groovy Language) was verbose and could have been better organized.
Conclusion: If part 1 of the book (covering the Groovy Language) had been more concise and better organized I would have rated this book 4 stars. Also, if you are going to buy this book be advised that at the time of writing this review (June 27, 2011) the second edition of the book is available as a preview from the publisher (Manning) and its purchase includes this edition (the first edition).
I was learning Groovy because the new testing framework we're using at work, Spock, is built on this (as opposed to jUnit, which uses Java).
As with most programming languages, if you don't have time to do the exercises, you won't get much out of it. You have to have time to play with it.
The format of showing a code snippet, with numeric tags applied, then explaining what's going on with each of the tags, is a useful one. Not quite as good as, say, Literate Programming. But still quite useful.
Groovy is a new programming language, that is based on Java, but has optional dynamic typing. Groovy also borrows features from Python and Ruby. The examples in this book appealed most to me. Even if, after reading this book as a Java developer, you still want to stick with Java, you would have learned just as much about Java as from any Java book. Groovy is after all very similar to Java.
This is still probably the best overall Groovy reference available. It has tons of great information that is hard or impossible to find on the web, and it covers everything from simple, command-line scripting to building web apps with Grails.
I don't find this book to be very practical or well organised, although it does give you a lot more background knowledge about groovy than some of the other books. I would recommend "Groovy Recipes" if you want to see groovy in practice.
- it's kind of old, it's for Groovy 1.0, hope to see second edition soon - Good reference for groovy language. Hope to see groovy make it to top 20 language.
A thick book that takes you deep into Groovy, demonstrating all its power. Those moving from Java to Groovy can probably stop a few chapters in, and then pick it back up once they want more.