Six ways to become a better Grails programmer

1. Read the Groovy books

Groovy is the heart of Grails, but it is surprising how easy it is to get by writing code the Java way.

I think it was four months after I started writing code in Grails that I started looking at the Groovy books, and they definitively helped me improve the code I was writing tremendously.

2. Consume videos, podcasts and blogs

There is no lack of new content being published on the web about Grails and Groovy. The following are my favorite resources:

3. Answer one question on the grails-user mailing list every week.

One of the things I like to do is to challenge myself to answer one question in the grails-user mailing list every week. Answering just one question forces me to sift through all the new questions coming through and seeing if I can find a quick and easy solution to a real world question.

Instead of answering something I already know, I try to pick a question that might take 5-10 minutes to answer. More often than not, the questions will force me dig into the code of a plugin or try to do something different within the grails console.

For me, this is the easiest way to come up with a guided exploration of ideas and concepts within Grails. I highly recommend it.

4. Read plugin source code and samples.

Something I found myself doing a lot is digging into the source of plugins like Geb or App-info and seeing how everything connects together. Other times, I find myself digging into smaller plugins like Taggable to understand how other people implement certain things.

I found exploring other people’s code allows me to add to my groovy manna that I can then use when writing my own code and plugins.

Another useful exploration is to expand the source code of the tag libraries within the Grails documentation by clicking Show Source. One of the better surprises for me recently is seeing how elegant the scopes within the g:set tag were implemented.

A final useful tool is to see and read the code that other people have written for the groovy web console.

5. Talk at / attend a conference or user group meeting. 

One of the more interesting experiences of my programmer life has come from talking at Grails conferences and user groups. There is just something about condensing the stuff you have learned and talking about it for an hour in a way that doesn’t put your audience to sleep. It forces you to spread out your thoughts and carefully examine the work you do. I highly recommend it.

If you rather just listen, there are a bunch of User Group Meetings.

A few conferences are also coming up to learn more about Grails, including SpringOne2GX, Groovy and Grails Exchange, Greach and the GR8Conf. I highly recommend attending those.

6. Work on a real project.

Of course, there is no better way to learn Grails than to interact with a real team of developers and work on a real project from start to finish. I’ve often found that the work we do day-to-day helps guide a lot of the blog posts and plugins I end up writing.

Many of my recent plugins like CDN-resources, Website Optimizer and Inviter have come from requirements in our projects. I find that by pairing and working with other people, the way in which I write code just gets better by leaps and bounds.

There seems to be a lot of opportunities popping up, you can always check Grails Jobs for the latest listings.

Shameless plug

Finally, if you’re in London and would like to learn more about Grails, why not consider working with Secret Escapes. We are looking for talented Grails developers, so get in touch.

10 thoughts on “Six ways to become a better Grails programmer

  1. Burt Beckwith

    #3 was very true for me. Early on I learned a tremendous amount by answering other peoples’ questions. It got me to dig into the Grails and Groovy code, and often plugin code, and I learned a lot about how everything works. It’s like teaching, but on a smaller scale – you always learn by explaining because it forces you to understand it well enough to come up with a fix and/or explain what’s going on.

    My suggestion goes against the grain I think, but I think it’s good to work on Spring and Hibernate (and the other technologies that Grails integrates) outside of Grails to appreciate how things work under the hood. When Grails-added magic doesn’t work, it can be very frustrating if you don’t know where to even start looking. But if you understand the underlying technologies it’s often a much shorter path to the solution.

    Reply
  2. Scott Frederick

    #1 was the first thing that came to my mind when I read the headline. As you said, It is easy to write Java code in a Grails app but really knowing Groovy makes the world a better place.

    #6 is also a big one for me. I learn a lot more by working on a real project, even on my own, than I do just by following tutorials or working on trivial examples.

    A couple more that have helped me:

    Write plugins. Even if you don’t (or can’t) put them in the public Grails plugin repository, moving code from an application to plugins can help organize your code. It also gets you ready for when you have that great idea for a public plugin.

    Learn (semantic) HTML, JavaScript, JQuery, and CSS. A lot of developers are hesitant to dive deep into these front-end technologies, but Grails scaffolding will only take you so far. If you want to have an app that gets people’s attention in the Facebook and Twitter age, you will be well served to be as comfortable at the front-end as you are at the back-end.

    Reply
  3. Lukasz

    Let me add a varation to #5 – if you work in a small or large company that doesn’t use Grails yet, you can offer a talk or a training on Grails. Two years ago, I started demoing Grails for different teams in the company I worked in. After a year of demos it resulted in a Grails project I could work on full-time (#5 led to #6). And a 2-day training made me read Grails in Action, reread Definitive Guide to Grails and finish reading Groovy in Action. Fully agree it’s a good way to get motivated.

    Another thing could be: get prepared for a job interview – something you mentioned.

    Reply
  4. Pingback: GroovyMag - the magazine for Groovy and Grails developers about Groovy programming and Grails development

  5. Enrique Medina Montenegro

    Tomas, you forgot to mention ‘observatoriodegrails.com’ and ‘forodegrails.com’ as Spanish alternatives for #2 and #3🙂

    Reply
  6. Pingback: Getting started with Grails and Groovy Java4Developers

  7. Pingback: Getting started with Grails and Groovy « hop2croft's software development Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s