Pair-programming and ping-pong game have something in common. Adrian Bolboaca, our trainer and coach, tells us about that on his blog. But being so interesting, he lets us to publish it here, as well.
- Learn pair-programming easier
- Force the “know-it-all” programmer to see other ways of writing code
- Force the “know-it-all” programmer to collaborate more
- Push for collective code ownership
The roles driver and navigator change often inside the pair.
This activity is like a game of ping-pong of the roles between the two members of the pair. They both can take short time decisions while being a driver and can spot strategic design decisions while being a navigator.
Refactoring can be made by any of the programmers on their turn, but only when the code and the tests are stable.
Variation with Timebox
You put a timer on the desk. Set it to let’s say 5 minutes (you can change the duration as you see fit) and start it. The driver and the navigator switch roles when the timer rings and both the code and tests are stable.
Variation for TDD
When doing TDD the driver writes exactly one test until the code can be compiled, but the test is red. The driver switches the role to the navigator. Now the driver, who was the navigator before, needs to make the test pass by writing the simplest code possible. After that the driver writes a new test until the code can compile, but the test is on red. Now the driver and the navigator switch roles again. In this way, considering that you have a simmilar average time to write all the tests, both the driver and the navigator have the chance to write tests and to write implementation code.
It is very easy to start doing it.
The facilitator, if any, needs to make sure the roles are changed in the pair.
The activity should be timeboxed and repeated.
Troubles with communication and effective team work? We can help with:
- An assessment on your organizational practices
- Calling one of our coaches in for facilitating a pair-programming session
- Attending the “Code retreat” workshop, also available in-company
- Attending the “Legacy code retreat” workshop, also available in-company
- Attending the “Refactoring” workshop, also available in-company
Is technical debt a problem? Try:
- Pair program with one of our coaches on refactoring existing code
- Attend the “Working FAST and Safe with Existing Code” workshop, also available in-company
If the situation is more complex, we would be happy to create a customized package for your needs.