Nick Carroll

Metabolising caffeine into code

Is your Pair hogging the keyboard?

with 4 comments

There is nothing more boring than sitting and watching your Pair hack away at the keyboard during a “pair programming” session. You lose interest in the problem and drift away to LaLa land.

Sharing the keyboard means engaging both Pairs in solving the problem. If you aren’t sharing the keyboard and allowing your pair to interact with the story being developed, then you may as well be coding by yourself.

Keyboard hogging is generally symptomatic of a lack of test driven development (TDD). TDD is a good practice to get into when pair programming. It allows for one person to write a failing test, and the other to make the test pass. Then the roles are reversed so that each person takes it in turn to think of a test to write, so that the other can make it pass. This is sometimes called ping pong programming because the keyboard goes back and forth quite frequently.

How do you know if you have a keyboard hogger on your team? Well that was the question that I’ve been pondering on for a while. Some people just don’t know they are keyboard hoggers. So you need something visual and metrics based to expose the problem. Something like a chess clock.

Digital chess clock

I used to play chess competitively and to prevent people taking forever with their move you had to clock-in when it was your thinking time, and clock-out when you finally made your move. The clock added that extra bit of pressure to get a move on.

When the opposition is clocked-in you still have to remain actively engaged in the game as you have to work out a strategy to counteract a number of possible moves that your opponent could make.

Pair programming should be more like this. It certainly makes it a lot more enjoyable. I remember the best programming sessions I’ve had was with Stacy Curl, now an ex-thoughtworker and whom I believe was also a chess player. He would always look to quickly make my tests pass, even if it was to just echo the output that my tests would sometimes expect. This often forced me to think about triangulating my tests so that my pair had no choice but to do some heavy lifting and implement the code.

If you have a keyboard hogger on your team, then try and introduce a chess clock. The timed metrics should make it obvious that only one person is engaged in developing the story, and the other is just pondering about the meaning of life.

Written by Nick

May 23rd, 2009 at 12:58 pm

Posted in Programming

Tagged with ,

4 Responses to 'Is your Pair hogging the keyboard?'

Subscribe to comments with RSS or TrackBack to 'Is your Pair hogging the keyboard?'.

  1. I think you may want to try the opposite as well – deliberately not swapping the keyboard for long extended periods.

    Pair programming is not just about taking turns at typing. The non-typer – aka the navigator – is meant to be engaged in solving the problem, but at a high level of focus (e.g. thinking strategically, not tactically).

    I’ve had great pairing sessions where the keyboard gets swapped back and forth. I’ve also had great pairing sessions where the keyboard never gets swapped (including where I’m not the one typing). The roles of the pairs differ between these syles of pairing.

    If you have problems staying engaged when you’re not the driver, then you aren’t pairing as well as you could be. Swapping the keyboard frequently is one way to deal with that, but it is a solution that keeps you in your comfort zone. Deliberately refusing to swap will push you out of your comfort zone and possibly into becoming a better pair.

    Robert

    23 May 09 at 4:03 pm

  2. [...] colleague Nick Carroll recently blogged some ideas about what to do if your pair is hogging the keyboard, suggesting using a timer which keeps track of how long each person has had at the keyboard as a [...]

  3. [...] Comments Pair Programming: It’s not about equal keyboard time at Mark Needham on Is your Pair hogging the keyboard?Robert on Is your Pair hogging the keyboard?Nick Carroll » Blog Archive » IR pen goes [...]

  4. [...] I pointed out some things that I disagreed with in Nick’s post about pair programming one thing that I really liked in that post was that he emphasised the importance of getting tests [...]

Leave a Reply