Summary: my report of the XP Day Benelux.
November 15, the arrival
I arrive with my friend Uberto to Charleroi airport in the morning. Pascal is so kind to pick us up and take us to Bruxelles on his sleek coupe. We have a nice meal right in the center of the old town, then we meet Philippe who takes us for a long walk around town. Then Pascal takes us to the conference center, a nice hotel in the middle of the autumn Belgian country. In the evening we meet again with them and a few other participants for a dinner in the nearby town of Mechelen. I have too much Belgian beer! Very nice evening.
Willem tells me “if you’ve come here to listen, you’ve come to the wrong conference.” And boy, was he right! Almost all the presentations I attendend in the next two days involved the participants to do some work.
November 16, first day
There’s so many different presentations to attend, and many are run in parallel! It’s a difficult choice. In the morning I attend the Coding Tournament by Markus Hjort and Lasse Koskela. It’s about writing a bot for an online game, and trying to do that in a way that is both XP, and is better than everyone else’s bot. The game is a simplified version of poker. There are a Java and a Ruby toolkit; in principle any language could be used, as long as you speak the right protocol to the Poker server. In practice there’s not enough time to write networking code. If you take the Java or Ruby route, all you have to do is implement an interface; no networking is required.
The rules of the game are simple: you are given a single card, but you can’t look at it. You can only look at everyone else’s cards. Each organizer demonstrated this by holding a card up to his forehead so that everyone but him could see it. Then a round of betting starts. Each player has a choice of staying, folding, or raising the bet. The betting stops when everyone has stayed or has folded. The point of the game is that you must base your decisions on what everyone else has, and how the others are betting.
My pair was Pascal Vogel from Philips, (Hi Pascal!) who doesn’t usually do Java; he knows C# though, and that is enough. We decide on a simple strategy, and write an acceptance test in JUnit for it. Then, we comment out the failing acceptance test, and TDD our way until the AT works. The idea is simply to look at the average value of everyone else’s cards, and fold if the average is high, and stay if it is low. This is more than enough to win a few games against the other bots.
Later we improved on this strategy by raising the pot when the average of everyone else’s cards is very low. Again, first we improved the AT, then we TDD’d until the AT was green.
Yes, it’s a very simplistic strategy. Yes, it may even be wrong (why take the average? The highest card may be more important.) Yet, this strategy won the final tournament! Yep, we won :-) It’s quite a challenge to implement correcly even as simple a strategy as this in about three hours. I don’t think we could have done it as well without TDD. It was tiring work, but not stressful.
My impression is that the choice of the rules is excellent. It’s complicated enough to make it interesting, yet simple enough that you can write a simple bot in the given time. The API you have to code to is adequate. I’m not so convinced about the format of the event though. The idea was to explain the game, and then do four iterations composed of 15′ coding and a 5′ bot tournament. After the fourth iteration the real tournament starts.
I was expecting something more along the lines of “now we coach you to do proper AT’s and proper TDD and proper pairing,” but we were more or less left to our own. Perhaps the organizers saw we were chugging along just fine, and spent their time coaching the other pairs. I was also expecting to be given some intermediate goals other than “write the best bot.” Something like, “first write a bot that always stays; then write a bot that folds when someone else has an ace”. I think the format of the presentation could be improved along these lines. I was given permission by Markus and Lasse to replicate the event, and I intend to try it with my local XP user group. Thanks guys!
In the afternoon I followed Vera Peeters presentation about simple design. It’s about how software can be made simple by not implementing unneeded features. The case in point were unit testing frameworks for C++, and how Vera got along fine with a tiny framework of her own, that was essentially just a few macros. After a brief presentation about what is good design, Vera asked us to form groups of five to six people. Then she had us write down on cards features of testing frameworks in general. Then she had us estimate how useful that feature is to us, and how well supported it is in our favourite testing framework. This allowed us to plot each feature on a graph and see how features are clustered. Finally, each group had to select a presenter to discuss and relate their findings. I found the whole experience interesting, both because of the subject matter, and because of the way the event was run. Quite unlike any conference I’ve been before!
The last presentation I attended was “A Fugue about Paradigms and Functional Programming”, by Emmanuel Gaillot & Christophe Thibaut. It was basically a coding kata done in Haskell. It is clear how skilled the two are at doing these public kata; the dialogue between the two was interesting and witty. Also the cheers at every green bar were fun! I haven’t done functional programming in a long time. It’s nice to see how clear and concise a functional program can be. The final program was a composition of functions; it involved very few variables, and no control structures except recursion (and it was very simple recursion.) The use of pattern matching pretty much does away with conditional statements. Getting rid of control structures is a worthy goal in code style, IMO. A great many important topics were demonstrated in very little time; interested people should definitely get a book about functional programming. The point of the exercise was also to pitch for a more functional style of programming, even when we program in non-functional languages. Modern languages like Ruby make it easy to do so.
In the evening, we are treated to a fine Belgian dinner. I manage to drink less this time!
Stay tuned for my report of the next day…