ping pong programming
i’ve first heard about ping pong programming somewhere in the thoughtworks corner. it’s a kind of enhancement to pair programming, but first let’s remember what pair programming was actually about:
in XP, all production code is written in pairs. 2 people sit in front of the computer. one is the driver, she has control over the keyboard and writes a test or some code. the other asks questions about what is being written and comments on the work. roles are frequently switched. the result is a higher motivation, increased velocity and an overall improved code quality - 4 eyes see more than 2
now ping pong programming: it is basically pair programming with extended rules. instead of simply swapping roles from time to time the driver starts writing a test that fails. then hands the keyboard over to the other, who now has to get the test to pass, and then extend it so it fails again. switch back, make test pass, extend it, switch and so on. the result is a higher switching frequency. that way, no one keeps driving for too long. as the peers prepare the task of their respective opposite, they develop a kind of healthy competition - who can write simplest code, the most elegant test etc.
so far the theory, people who have tried it report that they wrote easier and clearer code, and generally had more fun than with just pair programming, where the frequent role switch is not enforced so sometimes one peer is driving for too long, which leads to frustration at the other side.
anyway, i’ll give it a try in the next couple of weeks, let’s see what it can do. more on this topic to come.
Tags: