Wednesday, November 12, 2008

Groovy and Grails support continues to improve with Intellij IDEA 8

<disclosure>I am a member of the Jetbrains "Seeder Program" which means I could potentially recieve schwag from Jetbrains. However, everything I write here is purely my opinion with no input for the Jetbrains folks</disclosure>

Back in those heady days of IDEA 7.0 all I really cared about was the Groovy and Grails support. There really wasn't a good IDE for doing Groovy and Grails. Netbeans was almost non-existent for Groovy and Grails support, the Eclipse Groovy plugin was maybe the best prior to IDEA 7.0 but by their own admission really needed more resources to make it a solid experience. This maybe wasn't so bad for Groovy because Dynamic OO languages (since Smalltalk) always seemed to be for VI fan-boys. But Netbeans (and Intellij) had done some work on a Ruby plugin that wasn't Great but was better than anything Groovy had.

Then months before IDEA 7.0 came out, the Jetbrains folks announced support for a Groovy and Grails plugin for Intellij IDEA. Oddly enough, just prior to them making the announcement I had written on the forums promising that if they would support Groovy I would pay in advance for a 7.0 license. I doubt that had a darned thing to do with their decision but seemingly out of the Ether they announce that they are creating a Groovy and Grails plugin.

I was so freakin' excited I immediately downloaded the source code and built the plugin...I remember it being quite difficult in those days and when I finally figured it out I posted again on their forums explaining to others how to do the same, although I unfortunately got the directions not quite right (oh well...).

The Groovy and Grails support in 7.0 FAR exceeded my expectations. Even at launch it was very usable and it continued to improve. I realized just recently how awesome it was when I was writing a Grails application with webservices in one IDEA window and the Client in the other and I had them both running in debug mode at one point making changes, setting break points... Just a fantastic experience!

So as not to disappoint, idea 8.0 is packed full of new features for Groovy and Grails. But I would still call them incremental. Perhaps one ommitance is a Grails Webflow visual editor. I noticed months ago they were doing something like that for Seam and it seemed (no pun intended) like they could have done the same for Grails. Maybe with Grails it is un-needed as Grails has an easy to use DSL. Maybe the visual editor would have detracted from rather than improved upon the workflow...

What has been added? Features I've already used and really like are the visual Grails plugin manager, Completion for Domain classes' dynamic methods and finders and the ability to invoke Grails scripts straight from Intellij. The funny thing is that none of these features let you do anything that you couldn't do before they just make it so much easier. Anyone who has been a long time intellij user remembers before intellij when you couldn't use a class from the Java standard libraries without having the Javadocs open because you had no idea what methods their were. Then intellij came along and we could just press ctrl-space and see a list of all methods. Now you can do that with dynamic methods added by Grails. Yes I sit around with my Grails documentation open these days trying to remember which methods I can call. No longer! In addition this means less mistakes. Likewise, the script quick invoker allows you to press ctrl-alt-g and get a text box to invoke grails scripts. Press your trusty ctl-space buttons and voila! All the commands are listed out for you.

I really appreciate the attention to detail shown by these changes and the lack of simply adding features that you already got from the command line without improving on them. My workflow has continued to improve since the first releases of the Groovy and Grails plugin for intellij. These changes are evolutionary instead of revolutionary but don't let that fool you. IDEA continues to be far and away the best IDE for Groovy and Grails development.


Joshua Jacobs said...

Have you noticed any changes in the way IntelliJ compiles your straight groovy?

I'll post to IntelliJ soon, but in case you have any thoughts, in a Struts + Groovy project I'm working on, with mixed .groovy and .java src (not the best practice, I know) IntelliJ 7 compiles without problem, whereas Intellij 8 suffers from cyclic dependencies.

Have you seen this?

iamsteveholmes said...

I haven't noticed that. Have you filed a defect with intellij or asked questions on the support forums?

The Intellij folks originally contributed the groovy/java joint compiler so there's not much reason it should be going bad now, but it seems pretty straight forward that you are experiencing these behaviors.

Eric said...

Am I the only one not impressed with the debugging in this environment? I realize dynamically typed languages makes that difficult, but the debugger likes to stop on the wrong line or show totally incorrect variable values. Have you noticed any improvement there in IntelliJ 8?

iamsteveholmes said...

I haven't tried out the debugger yet. Although I end up relying on the debugger at least occasionally on a project I tend to view debuggers as a last solution, usually relying more on logging statements and such.

I was quite impressed with the debugger in IDEA 7 although I agree that there was odd behavior at times. I'd be curious to hear from folks who understand the technology better than I do (which wouldn't be saying much) as to what it would take to improve upon that. Improvements to the debugger was not a feature announced with IDEA 8 so if that is a deal maker/breaker for you I'd look into their complete list (maybe a JIRA list) to see what they have done.

Monkey Search