Get ${Stuff} Done with Groovy

by Marc Hedlund

Related link: http://groovy.codehaus.org/



I've been using and very much enjoying Groovy, a scripting language for the Java Virtual Machine (JVM). It's a great scripting language, and it provides you with access to all of the class libraries available for Java. In other words, you get all the benefits of Java without having to write so much bloody code all the time. As someone who learned Perl and then Java and then a set of other languages, I'd also say Groovy doesn't have the write-only, read-none properties of Perl, nor the Doctorine of Greatest Surprise of Python, nor the too-Perlish-but-why question of Ruby. These are my aesthetic opinions; yours will certainly vary. But I find Groovy to be a very comfortable, lightweight scripting tool without the drawbacks of these or other similar options.



Groovy is early in its life, and while it is on the path to standardization through the Java Community Process, it still has a lot of rough edges. On top of that, the documentation is very scant and in some cases downright speculative (some feature ideas are documented as features). As an O'Reilly person, I think that's great -- we will be able to sell lots of great books making that situation better. As a developer wanting to get work done right now, though, it leads to a bit of misery -- not enough to abandon the language, but enough to have spent too much time reading Java source code to figure out the source of my Groovy bugs.



So, this is the first in a set of blog posts I'm calling the "Get ${stuff} Done With Groovy" series -- I'll just call it G$D/Groovy from now on. They will not be tutorials nor step-by-step introductions to the language -- I'll assume you have made a stab at reading the language guide. Instead, each one will take one particular task I've learned how to do -- particularly one that took some amount of deciphering to figure out -- and demonstrate it. A lot of the information will be specific to the current version (1.0-beta-6, as of this writing), but some will not. Be sure to check for notes on the current version to see if you can skip some of the workarounds suggested.



All of the G$D/Groovy posts are now indexed on a reference page.



I think you'll like Groovy, and I'd like to make it more easily usable by a wider audience, so it grows and thrives.


1 Comments

alanvgreen
2004-09-19 21:59:54
Groovy compared

"... Groovy doesn't have the write-only, read-none properties of Perl, nor the Doctorine of Greatest Surprise of Python, nor the too-Perlish-but-why question of Ruby."


Neither does Groovy wrap itself in 30 year old, line-noise inspired C syntax in the hope that it will attract the Java fanboys. OK, maybe it does. But only a little bit.