Friday, December 28, 2007

Justify using Groovy






class GroovyFileTest {
def void test() {
println new File(file).text()

public void test()
Class class1 = GroovyFileTest.class;
Class class2 = groovy.lang.MetaClass.class;
(GroovyObject)ScriptBytecodeAdapter.castToType(this, groovy.lang.GroovyObject.class),
"println", new Object[] {






Aldrin Leal said...

Your post reminded a silly ad I once saw. I'm rewording to make the point clear:

g   r   o   o   v   y
Justifies Everything

(Ok. Pretend I didn't comment, ok?)

Anonymous said...

After JavaOne '06, I really fell for Groovy and Grails. I sung their praises to just about every developer I knew that I thought was worth telling. I bought e-books and soft copies of Groovy in Action and the Definitive Guide to Grails, just to support the authors.

Eventually, I became slightly less of an evangelist. I had less debates. Less persuasive discourse with folks on my team. I still used the tools, I just talked about them less. But what I realized was that I had started using a pull-model instead of a push-model. I was getting cool things done quickly, and people started asking me how. Soon people were asking me to send them groovy scripts.

That's my experience getting people to see the coolness of it. Just use it and eventually, people will see why it kicks ass and come asking how you did it.

CaptainCanuck said...

I like Anon's comment on pull versus push.

Another thought: more than a list of features, Groovy has a slightly different mindset than Java. That mindset is powerful and addictive. Though not often mentioned, it is reminiscent of Python.

The big win, IMHO: Groovy is so approachable and easy to work with that it encourages writing of features/programs that would otherwise be too much drudgery in Java. Though it can certainly be used for full-blown apps (e.g. Grails) it is also great for peripheral features _around_ a core Java app.

To be honest, I find other languages sexier and more interesting. Groovy is just the charming puppy dog that won't go away and keeps winning me over.

Joe Kueser said...

This is probably a stupid analogy, but it popped into my head, so I'll spew my garbage anyway...

Let's say you take the same road to work every day. It takes you 45 minutes to get to work, it's a little painful, but you get there.

Then they put in a bypass that allows you to get to the same destination in half the time.

Why would you choose not to use the bypass?

I'm hearing similar arguments against using Groovy. "Why would I? There's nothing you can do in Groovy that you can't do in Java!"

Groovy's a bypass that will get you to the same destination as Java in less time. And, oh, by the way, it's also a more scenic drive with less traffic. But, hey, you go right ahead and take the long way. I'll probably be gone when you get here.

jlorenzen said...

The maven-groovy-plugin has been renamed the gmaven plugin.