Friday, October 7, 2011

Teacup Programming

Teacup Programming is a variation on pair programming.

Why teacups? While sitting around a round table during a team retrospective where we had mentioned pair programming the conversation drifted a little when someone said it felt like we were sitting in a teacup ride or something.  Naturally, this led to combining the two ideas and teacup programming was born.

The idea is based on amusement park rides where the rider spins a wheel in the centre of the ride to increase the spinning velocity of the rider's individual car.  The most widely known example of this is the Teacup ride at Disneyland.


Requirements

  • An even number of programmers 
  • a table (round is preferred but not necessary and a rotating table is even better)
  • one computer for every two programmers

Steps


1. Sit the programmers around the table with a computer in front of every other programmer.
table setup
2. Each programmer with a computer begins working with the programmer on his or her right.


pairs with person to the right
3. After a designated period of time, say 30 minutes, the pairs switch.  This is done by either rotating the table one spot to the right or having everyone move left one spot so the programmer on the right from each previous pair is now sitting in front of a computer.

rotate the table one spot
after rotation
4. Again, each programmer with a computer then begins pairing with the programmer on their right (this is a consistent rule for creating pairs) and the timer is reset for another 30 minutes.

again pair with person to the right
5. Goto 3.

The key point in this rotation system is to always have the one programmer from a previous pair remain working on the same computer and thus on the same problem to help reduce lost time due to context switching.  Also, everyone at the table gets a look at each problem which means more eyes looking at the code.  The drawback is that one programmer only ever works with two others at most.

Variant
programmers "leap-frog"
A variation to increase the number of pairing combinations is to have the person relinquishing control of a computer get up and "leap frog" positions one direction or another.  This adds more complication to the rotations but allows an individual to pair with more people in the group.

We have yet to actually try this out and so cannot say whether it is a viable technique or not but I think it does have some merit and there may even be some specific situations where it might be best applied such as at a hack-a-thon where there is a long list of problems or bugs trying to be solved none of which are too lengthy or difficult or for practicing for a programming contest where people are just trying to solve as many problems as possible.

If anyone gets around to actually attempting this please post a comment with the results.

No comments:

Post a Comment