Pair Programming

Relevant categories: Process & Methodology

You may have recently heard the word pair programming many times. In pair programming, two programmers sit beside each other in front of one computer. One of them, which is called driver, types the code and the other one, called observer, checks for errors in each line. What the observer can do is more than this. While the driver is writing the code, the observer guides the development of code, considers the details, comes up with new ideas, and in general has a wider view which helps the driver in focusing on every aspect of the code.

Study has shown that if programmers who are made to practice pair programming very soon adapt themselves and adopt the technique. The main reason for this is that pair programming is much faster than individual programming. Laurie Williams from the University of Utah in Salt Lake City has done an experience on pair programming. The experiment shows that although pair programming is 15% slower than individual programming, but it results in 15% fewer bugs. Inasmuch, the cost for debugging is far more than the initial programming and thus, on the whole, pair programming is more satisfactory both for the team and the business.

Pair programming has the following key advantages:

  1. Pairs could help each other by teaching each other new things. In fact, they are supplementary.
  2. Working in pairs help them to focus more on the design stage.
  3. Pair programming improves the functionality that causes a better quality and fewer bugs in code. This will result in lower overall project costs.
  4. Study has shown that by pair programming, programmers feel more satisfied about their work and their self-steam is higher.
  5. Since each two developers use only one computer, fewer workstations are needed.
  6. When working together, problems can be solved more easily.

On the dark side, pair programming has a few disadvantages including:

  1. Sometimes pairs talk together about subjects not related to their work and lose some time.
  2. Pairs might not feel comfortable working together due to different working habits.
  3. Professional programmers could feel bored training junior ones.
  4. Less professional developers are not confident working with professional pairs and they might setback from participating.
  5. Pairs might conflict because they may opt differently about coding styles, and they might feel uncomfortable working together.
  6. Some of the professional programmers desire to work on their own.


Links: