Nov 13 2010

Groovy & Grails tutorials

A few weeks ago I gave a 3 day intro course on Groovy and Grails. I had little time to prepare but in the end all went ok and the participants were very surprised of the dynamic nature of the Groovy language and of the easy of development that Grails brings to the Java world.

In the middle of the course preparation I ended searching for a way to store the data of the presentation in a non-binary way, that is, in a textual format, so that I could version it and diff it correctly. I found schacon‘s ShowOff and tried it. I liked it a lot so I use it for my presentation. This is how you install showoff in Debian Squeeze:

Install rubygems:

aptitude install ruby ruby-dev rubygems

Update rubygems:

gem update

Install ShowOff

gem install showoff

Then I moved to the ShowOff’s directory for my presentation and ran:

showoff serve

This make my presentation show up in port 9090 of my local machine. So I browsed to http://localhost:9090 and there it was.

Of course ShowOff isn’t MS PowerPoint, and doesn’t try to be either. Instead, it offers a few basic styles, transitions and font styles and sizes. Nothing else. And this is what puts ShowOff apart of any presentation software. It is so easy to setup and have a web-enabled presentation in minutes.

One thing that is missing and it is needed a lot is a way to convert the presentation to PDF format, so it is easy to share to other people or to upload to sites like slideshare. Other than that, I didn’t need some particular feature of PowerPoint. Less is more sometimes.

Anyway I am releasing the Groovy & Grails presentation as a Creative Commons Attribution-NonCommercial-ShareAlike license so, feel free to use it and improve it.

They are hosted on GitHub:

Groovy Tutorial

Grails Tutorial

So fork them and use them.


Nov 13 2010

Git

In the middle of the Grails project I am working right now, I decided to try Git. Well, I decided to try also Emacs, after more than 10 years of using Vi. Man, that is like trying to rewire your brain. Amazing how the Vi commands are hardwired to my fingers muscles. In the end I succeded, although it will be a long time before I settle for one of them. Right now I am using Emacs for development and Vi for Linux administration.

But I digress, this post is about Git.

In short, Git rocks! Or more precisely distributed version control systems rocks. I haven’t used bazaar, nor mercurial or any other DVCS but the same applies to them I suppose. I will talk about Git.

Again, Git rocks, it is a different way of working in everyday’s chores as a programmer. And the blessing of local commits already made me forget Subversion. But more than that, the concept of cheap and fast branching it is so amazing that you will measure every other SCM branch capabilities using Git as reference.

The internet is full of tutorials about Git, but what I think that is the best explained intro (and advanced too) guide to git was the Pro Git book. So if you’re considering to try Git, start right  there as this book will make you a Git user in a couple hours.

I use to have all my repositories (23 right at the time) in Subversion. I migrated them all in a day to Git and I am more than happy with this change. In the project I am right now there is no possibility to switch to Git so I have to use git-svn to connect to Subversion and keep using Git on my machine. But even so, it gives you a real sense of security to commit always locally and then, when everything is tested, push to the central server.

So, try Git, and use the Pro Git book to learn it the right way.