Archive for December, 2008

Programming by Intention

Posted on December 6th, 2008 in Agile, Craftsmanship, Programming, TDD, Work | No Comments »

In an area dominated by acronyms like DRY, YAGNI, FIRST, SMART, KISS or catchy expressions such as Fake It Till You Make It and Baby Steps, a very important practice which is becoming forgotten is Programming By Intention:

This is the practice of pretending that classes, functions, procedures etc. exist (even though they do not) as you structure and write your code. This helps a developer think about the overall process and larger steps of software rather than the small details.

Although it may sound a little weird, the definition above really points to essence of this practice: pretending a piece of code is there to help you focus on the bigger picture. It forces us to think about what we’re trying to achieve instead of going into all the details first. And this small change in priorities makes a huge difference.

As critical thinkers we are always breaking the problem into smaller pieces and trying to put them together like a puzzle. And sometimes we decide to build these pieces one by one in sequence, and not by importance. By adopting this approach we lose great opportunities to learn early about the solution we’re building. We also lose time refactoring and throwing out code when we realise the pieces could be arranged in a simpler or more understandable way.

And that’s where the beauty of Programming By Intention lies: it effectively helps us to make sure we’re solving the problem first, and writing all the support for the solution later. And that’s why I wish there was a buzzword for it too.

Impressions of the first open coding dojo at Skillsmatter

Posted on December 5th, 2008 in Coding Dojo, Programming, Work | 3 Comments »

Last Monday we had our first open coding dojo at Skillsmatter. Although we didn’t manage to decide all the details beforehand on the mailing list, I believe it worked pretty well for a first session.

With 11 people attending, this dojo was challenging in different ways. The problem we tried to solve was the BankOCR, which only two or three people had tried to solve beforehand. The language was Ruby, which most people didn’t have tried before. And the environment was MacBook+TextMate, which was also something new for almost everyone there.

The randori started right after we had some time to read the problem description and had a minimal discussion on how to approach it. The pairs were rotating every 5 minutes and we manage to code for almost 1 and a half hour before running a quick retrospective at the end.

Most of the attendees had been in dojos before, which made things run smoothly most of the time. On the other hand some people felt a bit lost during the session, and that was one of the first things brought up during the retrospective. To avoid that in the the next sessions I’ll be in charge of doing a better introduction to the newcomers about the dojo and its rules.

At some points people also had problems with the keyboard from the Mac, which is something that could be easily avoided and hopefully won’t be a problem next time.

From my point of view, one of the highest points during the retrospective was when someone brought to attention the fact that people tend to radically change the approach of the implementation once is their time to actually code. Ryan’s insight was that from many perspectives the dojo is very similar to improvisational comedy: the current state of the code has be used as a source of inspiration and giving it continuation will definitely keep the audience involved. In simple terms: go with the flow!

In general I was very pleased by the reactions at the end of the session and specially the discussions we had in the pub afterwards.

The generated source from this session is available on the dojo’s repository on github. There is not a lot there, but it may be interesting for people to continue that implementation and keep discussing it on the mailing list.

Although I didn’t manage to do it this time, the idea is to discuss the problem and the session style in the list and then publish on the Skillsmatter website before the event, so people who are not in the list yet can have more details about what we’re planning to do. If you decide to join now make sure you check the previous topics to know what’s going on.

If you are interested to watch the whole session, here’s the video:

The next session will be on 14 January and the registration is already open. See you guys next time!