Computer Sciences Dept.

CS 367: Introduction to Data Structures

Spring 2005
Instructor: Prof. Mary Vernon

Tues. & Thurs. 1:00-2:15pm, 1221 CS


Pair Programming Advantages and Tips

The following tips and advantages of successful pair programming are summarized in a paper by Williams and Kessler:
  • As a component of Extreme Programming, pair programming has demonstrated anecdotal but impressive success on large and complex production systems, for example at Chrysler and Ford Motor Company.

  • Advantages include continuous code review, leading to tighter and more efficient code that is often closer to 100% bug-free

  • Another benefit of working in pairs is that less time is wasted (e.g., reading email, surfing the web, etc)

  • Skeptical experienced programmers have performed better in pairs and reported greater enjoyment and greater confidence in their solutions

  • Together, a pair will come up with more than twice as many possible solutions than the two would have working alone. They will then proceed to select the "best" solution more quickly and with better quality.

  • Tip: one person is the "driver", typing and recording the design ideas; the other person is actively engaged in analysis, design, and code review

  • Tip: take turns "driving"

  • Tip: view pair programming as a means to improve your knowledge and skills, rather than worrying about the skills you haven't yet acquired

  • Tip: For favorable idea exchange, there should be some healthy debate; effective pair programmers hone the fine balance between too much and too little ego during an initial adjustment period.

  • Tip: Program side-by-side, sharing the keyboard & mouse; "slide the keyboard/don't move the chairs".

  • Tip: Partner buy-in is critical to pair programming success.

  • Tip: Inevitably, pair programmers will work on something independently; review this independent work when you rejoin and incorporate it into the project. Extreme programmers re-write the independent work; otherwise, make sure the review is thorough.

  • Tip: Periodically take a break, disconnect from the task, and approach the task with freshness when restarting. Informal discussions also allow for effective idea exchange.

  • Tip: It may be desirable to do experimental prototyping, think about deep-concentration problems or write simple, well-defined rote code alone and then review with the partner.

  • Tip: Both partners own everything equally, including each mistake, as if the program is produced by a singular good mind.

 
Computer Sciences | UW Home