11 Code reviews and pair programming

 

This chapter covers

  • What pair programming is
  • Code reviews or pair programming—which one?
  • How pair programming complements code reviews
  • Integrating pair programming
  • Considerations for effective pair programming

Pair programming is an approach to software development where two programmers work together on a single workstation or a shared, online collaborative IDE [1]. There are several styles of pair programming (which we’ll talk about briefly), but the driver–navigator style is the most commonly used one. Here, one developer is the driver and focuses on writing the actual code, while the other is the navigator and focuses on reviewing the code being written in real time. A pair typically sits at a shared workstation where both have an equal view of the screen, and often, each developer has their own mouse and keyboard. Both developers are encouraged to communicate constantly and to switch the roles of driver and navigator often so that neither role is confined to a single person.

11.1 Do we do code reviews or pair programming?

11.1.1 Complementing code reviews with pair programming

11.1.2 Pair programming can’t replace code reviews

11.2 Integrating pair programming

11.2.1 Convincing your team to try pair programming

11.2.2 Pairing styles

11.2.3 Considerations for effective pair programming

Summary

References