Code Sparring: a fun way to practice programming
December 14, 2009
Last week, the Swedish ALT.NET group hosted an experimental Code Sparring night at the RemoteX offices. The idea came from the experiences we’ve had with coding dojos and the problems we recognized with that particular way of evolving as a coder. Mainly we felt that there was too much idle time for the people not sitting at the computer, and things quickly became messy with complex communication behaviors disturbing the overall experience. So I suggested that we should work on programming challenges in pairs instead.
Sparring in martial arts
There are many metaphors for software development taken from the world of hurting other people, and this is no different. I have some limited martial arts experience, mainly MMA, and I’ve always found that the most rewarding part of practice was the sparring.
A sparring session usually consists of people pairing up to try out their skills in a slightly more realistic environment that is still safe. The sparring may be very broad, i.e. everything is allowed, or sometimes only a subset of techniques can be utilized or you have to accomplish a specific goal (such as a rear naked choke).
A boxing class, for example, might start off with warm-ups and then move on to technical drills, such as a improving hand-eye coordination, like the guy to the left, or specific striking combination for 30 minutes. After that, you could finish with 30 minutes of sparring. The sparring is usually done in pairs, and you go at it for a round and then change your sparring partner. The goal is of course to improve and during the rounds you learn from each other, help each other and get to apply fine-grained knowledge in a complex and fluid situation.
How well does it translate to our profession?
Very well if you ask me. We can say that learning the programming basics through reading books, attending courses, practicing katas etc. is like drilling, and our day jobs are like a real fight in front of an audience. So code sparring should be something in between that is safe (e.g. you wont harm any important production code) and less competitive/dangerous.
I know that Micah Martin has a different definition of what code sparring is, but that was a sort of competition instead of what I feel sparring really is. I’m not saying that it’s a bad thing, but I’d call his version “light contact coding” or something.
Anyway, to emulate real programming work more than a dojo did for us, roughly 10 people gathered at a big table and paired up. In order to keep things fluent, fun and to learn to know each other better, we rotated every 20 minutes. Due to the fact that people might feel uneasy about the prospect of handing over their sacred computer to others, the ones who brought laptops stayed put, and the others switched seats by moving one step to the left. The assignment we chose to work on was the KataYahtzee, driving the implementation out using test-driven development.
This was a very pleasant experience, far more enjoyable to me compared to a coding dojo, and the rest of the attendees seemed to agree. Before we knew it, the time was 10pm and we had to go home.
The people who rotated always had fresh and clever ideas from the other pairing stations they had been at (just like consultants, eh?) which merged together with the existing code to evolve into something new. And constantly being part of a pair meant that everybody seemed to be focused and utilizing the time efficiently from start to finish. Also, unlike a dojo, any group size should work for this kind of exercise.
The constant change of pairs also meant you had to be able to quickly communicate the whats and the hows of the code to your new partner, which sharpens your verbal skills as well.
The biggest problem that I could see was the strict division between the laptop owners and the more consultant-like people who changed code base every 20 minutes. Some people were not content with sitting in the same seat all night, so there’s room for improvement. Make sure to read Morten Nielsens summary of the sparring as well.
Why don’t you try a code sparring night in your office or with your local user group? If you do, tell me how it went and any suggestions you have for making this better.
Using a personal kanban board
October 30, 2009
For a few months I’ve been using a personal kanban board as a way to becoming more effective, efficient and knowledgeable about the process that goes into my work. It’s only been used for hobby and home projects, because that’s where I felt had lost control and stuff just kept piling up.
I’ve always known that my main problem was initializing too many projects only to become stressed out by everything, unmotivated and abandoning most of them halfway through, which in turn led to a sense of failure and broken promises, either to myself or to others. Therefore the Work In Process (WIP) limitations of a kanban board seemed like a very good idea, and I quickly set one up for free at Zen. After adding some WIP limitations to the Working column, I got started and the results came instantly: I’ve been finishing up some old projects that I’ve had in the back of my mind for years. All of a sudden I know that when I start a project, I will finish it. Even if it becomes stale or boring, I have to push through before I can move on to something that seems like more fun. Just knowing that is a great motivator for actually finishing stuff, thereby delivering some kind of value.
My kanban board is very simple: I have a backlog, a Working column, a Complete column and an archive (where items I’ve finished long ago go). It seems almost too simple compared to what large teams use, but hey – there’s no team in I (and vice versa). The Working column has a WIP limit of 2 items, of which one can be computer related (e.g. reading the RSpec Book) and one can be related to something else (e.g. painting the walls). I noticed that if I allow myself to do two or more computer related tasks at once, I jump back and forth depending on the mood. That in turn leads to the pace feeling a bit slow, which lowers the motivation to work on stuff even more, which makes the pace even slower and so on…
I’ve actually completed many more items than are in the Complete column above. I’ve just moved them into the “Archive” column. Just so you know.
Since I only have three columns, the visualization part of the kanban isn’t as prominent as when you’re working on a bigger team. Neither the backlog nor the Complete column can be bottlenecks, all I have to analyze from this perspective is the Working column, and it’s always full. I tried having more columns in the beginning, just to be able to identify bottlenecks, but it always felt contrived.
So the steps for you to get started with a personal kanban are very few:
- Create a board with columns and determine the initial Work In Process limits (you can change them later, it’s an open process).
- Create tasks/stories and put them in the backlog.
- Start pulling from the backlog.
- Analyze what goes well and what doesn’t, and start reaping the benefits of actually getting things done. It sure feels good pulling items into that column.
Once those darn walls are painted, my fiancee and I will put up a common kanban board for both of us in that room (the guest room/office). I’ll report on that in a future blog post.
How to become a programming expert
October 29, 2009
I just finished reading a very interesting paper by K. Anders Ericsson, Michael J. Prietula and Edward T. Cokely called Making of an Expert. Ericsson, a Swede, is “widely recognized as one of the world’s leading theoretical and experimental researchers on expertise” according to Wikipedia.
The paper sums up what seems to be the general idea in contemporary psychology of what it takes to become an expert in any field: deliberate practice for an extended period of time (10.000 hours or 10 years at a minimum), constantly throwing yourself at new challenges, having experts/teachers/supervisors around you etc. It also states that “across a wide range of experts, including athletes, novelists and musicians, very few appear to be able to engage in more than four to five hours of high concentration and deliberate practice at a time”. Finally I don’t have to feel guilty about not being able to perform complicated programming tasks after 2 o’clock anymore! What a relief.
The authors also give a nice tip of how to improve your skills on your journey to becoming an expert, by trying to replicate masters in the field and then compare your result to theirs, analyzing the differences and drawing conclusions upon that:
“Say you have someone in your company who is a masterly communicator, and you learn that he is going to give a talk to a unit that will be laying off workers. Sit down and write your own speech, and then compare his actual speech with what you wrote. Observe the reactions to his talk and imagine what the reactions would be to yours. Each time you can generate by yourself decisions, interactions, or speeches that match those of people who excel, you move one step closer to reaching the level of an expert performer.”
This apparently translates to any job. It’s truly inspiring, and I believe a good way for programmers to start is by looking at the expert programmers around the world. Read their books, understand how they think, and mimic it until you know it by heart, then analyze it. Memorizing a code kata seems like a good way to add to your 10.000 hours of deliberate practice
Here are two katas to help you get started right now:
Robert Martin’s Bowling Game Kata
Robert Martin’s Prime Factors Kata
See you in 10 years!
My object database lightning talk
August 6, 2009
I just found the video of my lightning talk on object databases for .NET. It was recorded during the February 2009 ALT.NET Unconference in Stockholm.
Thanks to Petter Wigle for recording, editing and putting it up on Viddler.
Edit: I’ve been told I’m looking back at the slides projection way too much during this presentation. I agree. It’s because someone changed the settings on the laptop just before my presentation, so that I couldn’t see what slide I was on on it’s screen.
Talk to yourself to solve problems
June 11, 2009
I’m a programmer and perhaps even a nerd, and as such I tend to focus on learning new tools, languages, patterns and other more technical details all the time. But at the core of my job is having good general problem-solving skills and these rarely get as much focus as cool demo webcasts of products to come etc. It’s just like school where you tried to learn facts, but never really learned how to learn.
I guess I’ve been thinking about this for a long time, but reading the excellent book Pragmatic Thinking & Learning: Refactor Your Wetware by Andy Hunt made me understand it at a much deeper level. Thinking and understanding aren’t the same as you’ll see.
The conclusion I reached was something that I’ve been iterating in my mind over and over during the last year: you need to learn how to communicate with yourself. Communicating with others is more visible and a highly sought after skill because it shows that you’re not a introvert geek, but being able to communicate with yourself is something that I think we all should strive for as well.
What really snapped my head into place was a bug I had been trying to solve for a few days. Yes a few days, that’s how long I was stuck on this little sucker. Just before going home on the second day, I started thinking about self communication and opened up a text editor and described the problem to myself as detailed as I could. Then I read through it and huzzah, the bug was solved within minutes. It was super simple, but I had spent the two days being stuck in a mental rut that I couldn’t escape as long as I only tried to code myself out of the problem.
The secret is the action of putting what you think about into concrete, actual words. This process switches your brain into another mode, makes you think about it a little differently and activates reflection on this subject in your mind which can go on unnoticed for weeks in your subconscious. You may believe that just thinking about the problem is enough, since you feel that you already know all you need to know. But that is a mistake. Expressing the problems differently is key to developing a holistic understanding, to start seeing patterns, to connect to the knowledge you have about the subject through different mental paths. The way I see it there are many clues in society that point to the benefit of this, such as the catholic confessions, prayer, psychotherapy, rubber ducking, letter writing, keeping a diary and so on.
So the next step for you, dear nerd, is to fire up a text editor or open a notebook and describe any problem you haven’t been able to solve for a while to yourself. It may be related to coding, work or even your personal life. Then you can throw it away, you’ve probably already benefitted from it. Do this over and over, perhaps through a simple exercise called morning pages, and you’ll start understanding the mechanics that are you and your mind and what you need to do to continually improve yourself.
It has done wonders for me anyway.
The 2nd ALT.NET unconference in Stockholm
February 4, 2009
The Swedish ALT.NET will be hosting yet another “unconference” (a conference driven by its participants) Saturday the 7th of February in Stockholm, i.e. a few days from now. Last time was an absolute blast, so if you’re into the .NET platform then I strongly suggest you chum along. ALT.NET is all about constantly improving your software development skills and keeping an open mind about what the best solution to different development problems might be, and not blindly accepting a “one size fits all” solution from any specific vendor. Just head over to the Swedish ALT.NET site to register (for free of course).
In addition to the open spaces discussions that we hosted last time, we’ll also be listening to some interesting lighting talks (very short presentations) at the beginning of the event. I’ll be giving one about object databases, and others will be talking about iPhone development, code rot, mocking, OpenTK, BDD with MSpec and Continuous Integration.
My blog according to Wordle
December 5, 2008

Cool stuff, I like Wordle.
Why do .NET developers fear open source?
November 25, 2008
The fear in the .NET community of alternative tools, especially open source ones, is doing a lot of harm to us. There’s a paraphrase I learned from the ALT.NET movement that goes “No one ever got fired for choosing Microsoft” (I think the original quote was about IBM). And it certainly feels like it’s tragically true, the fact that we only trust Microsoft to provide us with everything and that nothing trustworthy can come out of the plethora of excellent ideas and tools that exist outside of Redmond.
Whenever I hear about this, I think of a person I talked to once. This person was going on and on about this open source version control system and how much it sucked, how they had never been able to get any support and how it showed just how rotten open source products are in general.
Curious to know, I asked the person what system it was. The answer I got was “SourceSafe”.
Of course I had to tell this person (not a developer mind you, but working in a .NET developer team) that it’s not open source software, but rather some crap that Microsoft has produced.
It’s an amusing story, and is serves as a good example of how many people working with .NET seem to feel about Microsoft vs open source.
Why the Oredev conference is the bomb
November 22, 2008
Last night I came back from Øredev, a developer conference which took place in Malmö, Sweden. And what a conference it was, so super crammed with nice and motivated people and interesting talks.
The first thing that struck me, months ahead, was the impressive line-up. No wonder I decided to go there instead of the more exotically located PDC2008. Big names such as Robert C. Martin, Eric Evans, Ayende Rahien, DHH, Kevlin Henney and Scott Bellware in combination with track topics that are really close to my heart, e.g. .NET, Agile Ways, Test, DDD, Cool Languages and ALT.NET made for a really interesting mixture.
In retrospect, the conference was an absolute blast. And I’m not the only one thinking so, in fact it seems to hold up really well in international comparison according to people who have been to more conferences than I have. Just read what Microsoft’s Glenn Block and Ayende Rahien wrote during their stay there.
I was more interested in the ALT.NET track (a full day) than the ordinary .NET track, because of the topics. Instead of some sort of corporate demoware sessions, which tend to bore me, I chose the alternative. After an excellent introduction by my collegue Joakim Sundén, interesting presentations were held by Scott Bellware, Ayende Rahien and Glenn Block followed by a panel debate featuring all of the above.
The best presentation was probably “Using Active Record to write less code” by Ayende Rahien, which was cocky and super motivating. Even though I have some experience using ActiveRecord, and pretty much knew about the features he brought up, I had the same “wow” reaction as everyone else did. If you can deliver an ad-hoc presentation which preaches to a converted and makes him want to re-convert, then you’re on to something.
I could go on and on about the conference, but suffice it to say that I’ll most definitely be going back year after year if they keep it up. Bravo!
The first ALT.NET unconference in Sweden
September 8, 2008
The first swedish ALT.NET unconference is taking place in Stockholm this Saturday (13th of September). It’ll be a fun day filled with open space meetings on different topics aiming to increase awareness of more than just the Microsoft way of doing things on the .NET platform. We draw inspiration from the open source community, other developing platforms and even Microsoft themselves in the quest for determining the best option for solving different problems.
To find out more, go to the swedish ALT.NET site, where you also can register for free.

