Archive for January, 2006

An experiment in free software development

Friday, January 27, 2006

Hugo Garcia has started an experiment in free software development, accepting and implementing user stories for free. He has received a first request from Jeff Langr through the XP mailing list. Check his blog, ooGo

I am following the Erdos model and have decided to donate my brain to the XP board. I have posted a message on the board offering my free services. I cannot find a position as a developer so might as well give it for free in order to do what I enjoy the most.

I’ll keep and interested eye on it.


TDD live demo in ruby

Sunday, January 15, 2006

Marco Abis has published all the stuff related to the Second Italian Agile day. This means that there’s also the zip file of all the steps related to my session.

I have collected all the different versions of the code that I was developing during my session, I have cleared them a bit (ie: I have removed insignificant steps, typos, etc.) and I have written a small comment for each step. What I have obtained is a sequence of 49 steps, made by 42 live steps and 7 offline to complete the work. What’s interesting is that first file was saved at 3:40:48 PM, while the last file at 4:41:06 PM ==> it means 42 steps in 62 minutes. Steps have not all the same length of course, but I can assure you that there are always less than 3 minutes between one step and the next one.


Lost in time, lost in space

Monday, January 9, 2006

Yesterday I’ve forgotten to add one important point to my post about “Everyday ruby”: after developing the script under Windows with ruby 1.8.2 I recognized I could have put it in crontab on a linux server, where several metrics are already gained or calculated every night. When I tried I had a bad surprise: our old linux server was running debian woody, an old stable release dated 2002, on which only ruby 1.6.7 is available. Hence, some of the libraries that I used were not available. For example, I have used new FileUtils module. After 5 seconds of panic I’ve thought that the script could easily recognize which ruby version is running, deciding to redefine a few methods for backward compatibility. It took me 10 minutes to understand what I was missing and write the following:

def is_old_ruby?
VERSION < "1.8.0"

require is_old_ruby? ? 'ftools' : 'fileutils'

if is_old_ruby?
def pwd
def mkdir_p(path)
Dir.mkdir(path) if !File.exist? path
def cd(path)
include FileUtils::Verbose

Ugly, but it saved my day.

It took me some more minutes to understand that I needed to invoke shell commands or external programs differently between Windows and linux. Therefore, with a little help from the following method, I’ve simply modified a few invocations accordingly:

def is_win?
is_old_ruby? ? PLATFORM =~ "mswin" : PLATFORM.match("mswin")

I know I could have done it the same way with other languages, but believe me when I tell you that backward compatibility with statically typed language is a lot more harder, even in the simplest case like this one.

This is another good reason why choosing ruby for your everyday tasks at the border of your programming environment may be a good idea. Even when java pays the bills.

Everyday ruby

Sunday, January 8, 2006

Some week ago I was doing a peer review of one of my team-mates. We came across one of the objectives that he had since our last review (more than one year and a half ago): P. should have deepen his knowledge and practice of the ruby language. The idea here was partially inspired by PragProg’s concept of “learn a new language every year”. Another source of inspiration came from the hacker’s culture as described by Paul Graham articles.
P. wholeheartly agreed with the objective and slowly started devoting some spare time to study ruby, mainly by means of reading the PragProg’s so called PickAxe book, at that time at his first edition, freely available on the web and automatically installed with ruby. The problem is that everyday job is to develop in java, there is really a little space for ruby in everyday activities.
Infact, P. clearly missed his objective, as he recognized himself as well. I wouldn’t blame him, I know and I have seen that he tried. Apparently there was really no time, nor any significant occasion.

But is this really true?