Le Ralf, The Blog
All | Moods | Prog | Rants | Android | Projects | Trackday
Generated on 2011-07-24 21:11:26 by Rig3 0.4-456
2007/11/21 Rig3
π 2007-11-21 00:00 by Ralf in Prog
One post every two months... not too bad :-)

I've been really busy recently.

First, on the work side, I changed teams at the beginning of the quarter. That was really good and invigorating. Lots had to be done, and lots happened.

Update: I generally tend to avoid posting about work and I will make no exception here.

Second, I changed my "workflow" at home.

I got real tired of not writing [Rig2|Dev/RigII] and decided to fix this.

I never got to implement Rig2 since the design was mostly self-centric: most of the design was driven by the desire to create a nice design. But there were no compelling features and thus no much motivation to start implementing it. Besides I had tried last summer to start the design and it had got boring and after a couple weeks of fighting I still had nothing to show but a bunch of self-referencing classes.

So I started again from scratch with Rig3. As indicated in the design doc, my plan was to implement the bare minimum that I needed right away. Then enough motivation would flow into the project to allow it to sustain itself.

To make this work, I had to focus on this single project for my spare time, and put aside a number of other ideas I had been toying with in the past two months. Too many competing ideas lead to spare time fragmentation.

And it worked. I started the design doc by finding which features I really needed that I didn't have. I found out that instead of re-writing Rig1 (the photo album) from scratch, I could just use it, and focus on resolving the current pain point -- namely that it was taking too much time to enter nice formatted posts in the Wordpress blog and that an [Izumi|WhatIsIzumi]/wiki-like syntax stored in plain text files with a pre-determined filename convention could generate those posts automatically.

Then I cut the feature set in two parts: the core "engine" part, which makes it possible to generate the content, and the "application" part, which actually generates the content. To start, I needed a bit of the engine and pretty much nothing of the application.

Then I cut the feature set even more so that I'd have a "two week" iteration -- the saint Graal of the over-hyped modern "extreme" programming paradigm. It turned to be more like a month-or-so iteration but it worked: I literally spend half an hour there, 5 minutes there, any time I had some time free and I could focus on the task, with the idea that I'd try to address at least one point of my task list per day. Think ahead where you want to go, split into small tasks and try to address them one a day.

At first I had nothing to show. Rather than rush to write a monolithic piece of "something" with no idea if it would work in the end, I used unit tests. Rather than focus on the naive and baseless mantra of "one test per method", I focused on a more sound strategy of "one test per feature". That is the idea of the test is to show that given task points get solved.

Accordingly half of the task points are for "feature X" and the other half are "UT for X". This means sometimes there are one or more tests for a given class or method, and sometimes there's just a single test that will test a top-level method and inner methods are not tested (kind of a black-box test.) In some rare cases, the result of a method call is really not testable, in which case I still write a test and even though I don't quite check the result, it acts as a coverage test.

There's more than 50% of the code dedicated to tests. One of my non-written goals was to keep the implementation as simple as possible and I think I did quite well on this.

Oh and I even rewrote my own template engine. In just 600 lines of python, including comments. This removes the need for the Django or Kid template libraries, which do too much for my needs and yet are not powerful enough.

Overall I'm very satisfied with Rig3 so far. After the initial cut, I started actually using it to produce content and quickly found necessary to add some of the features that didn't make it in the very first release. Most of the engine part will stay like this, changes are more expected on the application and templates part.


More pages: October 2008 June 2008 November 2007 May 2007 December 2006 August 2006 July 2006 April 2006 January 2006 December 2005 October 2005 September 2005 June 2005 May 2005 April 2005 March 2005 December 2004