Chapter 17. Pair Programming

Laurie Williams

Pair programming is a style of programming in which two programmers work side-by-side at one computer, continuously collaborating on the same design, algorithm, code, or test. Pair programming has been practiced sporadically for decades [Williams and Kessler 2003]. However, the emergence of Agile methodologies and Extreme Programming (XP) [Beck 2005] in the late 1990s brought the pair programming practice to more recent prominence.

With pair programming, one of the pair, called the driver, types at the computer or writes down a design. The other partner, called the navigator, has many jobs. One of these is to observe the work of the driver—looking for tactical and strategic defects in the driver’s work. Some tactical defects might be syntax errors, typos, and calling the wrong method. Strategic defects occur when the driver’s implementation or design ultimately will fail to accomplish its goals. The navigator is the strategic, long-range thinker of the programming pair. Because the navigator is not as deeply involved with the design, algorithm, code, or test, he or she can have a more objective point of view and can better think strategically about the direction of the work. Both in the pair are constant brainstorming and chatting partners [Wray 2010]. An effective pair will be constantly discussing alternative approaches and solutions to the problem [Vanhanen and Korpi 2007], [Williams and Kessler 2003]. A sign of a dysfunctional pair ...

Get Making Software now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.