Tuesday, February 9, 2010

Grails: It Just Makes Sense

Grails. It just makes sense.

After a recent Gateway Groovy Users meeting, some of us were talking about the adoption of Grails, which is still on the rise. The signs are everywhere: the increasing number and turnout of Groovy user groups, the number of openings on various job sites, the increasing number of Java frameworks that are including Groovy support.

This led to another question. Why do individuals and companies still say things like “We can't use Grails because we are a Java shop”? Do “Java shops” use Spring? Spring beans can be written in Groovy. Do “Java shops” use JSF? JSF backing beans can be written in Groovy. Contrariwise, most Grails artifacts can be written in Java. Grails is a Java framework, just like Spring, JSF, etc. It just happens to be the first one out with Groovy support – and the best Groovy support, at that.

Consider that Grails uses Groovy for some things for which other Java frameworks use another non-Java language – one that is much further from Java in syntax and usage than Groovy. XML is not Java. XML does not compile to Java byte-code. Grails allows you to use Groovy for many of the things for which other frameworks require (or used to require) you to use XML. Now some other Java frameworks are providing support for Groovy in configuration files, instead of XML. So the differences continue to blur.

More and more developers are seeing the value of Groovy, and consequently tools like Grails and Griffon. You can see this in various polls around the internet, some of which we've discussed in a previous blog post. Now there is hope that more decision makers will get a clue. In a recent article on Forbes.com, Dan Woods makes the case for Groovy in companies that already use Java. The whole article is good, but this line pretty much sums it up: “For a company with a heavy investment in Java, Groovy should be a no-brainer.”

I'm not saying that every Java developer should start using Grails, though that might not be a bad idea. :-) There are some that prefer a component-based framework such as JSF or Wicket to a page based framework like Grails. That's fine: with JSF 2.0 and its Groovy support, JSF is showing some promise.

The bottom line is to use the framework that will help your team be the most productive and do the best job. But we need to get beyond the “we can't use Grails because we are a Java shop” stuff. It just doesn't make sense.

Friday, February 5, 2010

My Favorite Tool

Years ago, I worked in construction, building houses. My favorite tool was my Estwing 28oz. waffle-headed framing hammer. I could drive a 16d nail in one hit with that hammer. (I also got carpal tunnel syndrome from using that hammer. But that's a different story.)

That hammer, because of its characteristics (its weight, its size, the pattern on its face, its textured grip, etc.), allowed me to do what I needed to do. Beyond that, it made it easier for me to do what I needed to do. No actually, that's not quite accurate.

The hammer didn't help me do what I needed to do. It helped me to do what I chose to do. In general, I chose to do what I needed to do, but the hammer played no part in that. I had a good boss on that job, and he helped me to determine what I needed to do. I also worked with some very experienced carpenters on that job, and they helped me to learn the right way to do what I needed to do. All the while, my trusty hammer was there just making things easier.

Not all of the tools I used were that way. My circular saw had a safety guard on it that made it difficult to see where I was cutting, and it got in the way when first starting a cut. It would then slide away as I went, but I would often hold it back out of the way when I was starting. The more experienced carpenters just removed their safety guards altogether. I'm sure there were accidents that the safety guards would have prevented, but I guess they were rare enough that most folks decided that the productivity gains were worth the risk. I was always amazed at how fast those guys could frame a house!

I used my saw because I needed to use it, and it was much faster than using a hand saw, but I don't look back at my saw with the same fondness as that hammer. In fact, I can't even remember what brand or model it was. There's just something about a tool that feels good to use: a tool that helps you do what you want to do, and then just stays out of your way.