A week and change after I intended to, I’m ready to write up some notes on the Haskell coding challenge I started a little while back. Since I don’t have a lot of specific points in mind, I’m going to try to do this in a sort of Agile-retrospective-for-one style.
So, at an objective level, what happened?
- I did produce seven different playable games.
- I put off doing day seven until several days later.
- On what would have been day 7, I got home from Seattle, collapsed in bed, and had a cold for the next few days.
- On several days, I had to cut scope from what I’d expected.
- I did manage to complete several small user stories each day – “user stories” in the sense that after each one, I could open up the game and verify the improvements to the game without reference to the source code.
- The last five games were several variations on the theme of robotfindskitten.
- It was harder to make changes at the end than it had been at the beginning.
- As expected, each day’s code built off of the code from the previous day.
- The test of the
playGame
function kept having to be changed for accidental reasons. - I have an easier time writing Haskell now than I did a week ago.
- I have a better idea of the key concepts in a game like this than I did a week ago.
What emotional responses did you have to the exercise?
- I was delighted with the whole experience. A+++ would program again.
- I was disappointed that I didn’t produce as much of a variety of games as I’d hoped for.
- I was surprised that I never hit a point where a reactive programming library seemed like the right tool to bring in.
- I’m a little afraid that people will laugh at how little I got done.
- I was happy to get a chance to pair on a little of this with Kim Wallmark, whose exhortation to “Work Tiny” was a big influence on this exercise, and with Matt Raibert, who I used to work with and always love programming with.
- I was frustrated that one of my tests was so brittle.
- I felt vindicated to discover that TDD was still a useful habit in a language with a type system as powerful as Haskell’s.
- I also felt frustrated that the code got unweildy as it grew, and that I wasn’t totally sure how to deal with it.
- I’m encouraged by the fact that I do have some ideas for how the code base could evolve.
- I am grateful to Leonard Richardson for writing the original robotfindskitten – it’s both a delightfully odd toy and a great thing to try and recreate.
- I feel accomplished and tired after the whole exercise: like I pushed myself hard and learned a lot.
- I feel a little queasy because I got one of the backwards-facing seats on my train to New York this morning.
What patterns do you notice here?
- This whole exercise reaffirmed my belief that user stories can scale down as small as you need them to.
- I noticed a problematic situation that I’ve also seen on bigger XP projects: the steady release rhythm left me time to do smaller scale refactoring, but often distracted me from stepping back and thinking about larger architectural issues.
- The target of having something playable at the end of each day was a big help to me: it meant that I had working software from the start, and got to think through tradeoffs in light of what I could actually accomplish.
- Red eye flights are never worth it. I got two hours of sleep Saturday night, and I’m convinced that’s why I got sick.
- I feel like the monolithic codebase was at the heart of some of the frustration I felt in the last couple of days of the exercise.
- Finding the right data structures is huge: which things should be tied together, which should be decoupled, and how should they be structured?
What do you plan to do as a result of this exercise?
- I’ll keep advocating for smaller user stories – roughly 5-10 per iteration – and for making observable progress throughout each day.
- I’ll do this exercise again periodically, and similar exercises for other technologies I’m interested in learning better (Python NLTK, maybe?).
- I’ll consider looking for different testing tools for Haskell.
- I’ll avoid red eye flights whenever possible. Where it’s impossible (see: the trip to England I’m planning this very summer), I’ll at least get plenty of sleep a couple of nights before.
- I’ll continue working on the robotfindskitten code base I produced here, both because I’d love to see it go further and as a testbed for thinking about design debt in XP.
- In projects I’m on, I’ll try to get developers periodic opportunities to step back for a little while for playful exploration of design issues, without the pressure to deliver anything. I’ll watch how this works. I’ll try it myself in this code base.