Skip to main content

Pair programming

Pair programming is where two developers work using only one machine - or in the remote world, where one person shares their screen. πŸ‘©πŸΎβ€πŸ¦³πŸ’»πŸ‘¨πŸΌβ€πŸ¦°

There are a few ways of running pair programming sessions, but the most popular is where one person acts as the "driver" who writes code, the other acts as the "navigator" who will check the code being written and also figure out where to go next. These roles can be switched at any time.

At some companies, pair programming is a core part of the engineering experience. It can be an important tool where code quality is critical, like in banking or similar industries where compliance requires security and safety measures for users.

You'll be working in pairs multiple times in this cohort. For your first pair session, the focus is pair programming, so here’s a quick framework you should follow.

Driver/Navigator Pair Programming Framework​

The Driver will...

  • Write code, run tests, have control of code
  • Focus on one problem at a time
  • Self-narrate at a high level (e.g. "Okay, now let's introduce a random number function", NOT "I'm now creating a variable named X that I'm assigning the value 4")
  • Assume your navigator can read the code and understand it; the goal is to communicate purpose and intention, not mechanics

The Navigator will...

  • Keep a "todo" list
  • Politely nudge the driver in the right direction (without taking control). Examples:
    • Can we write a test for that?
    • Can we refactor a bit now?
    • Let's check in
    • Let's revert
    • Let's take a break
  • Aways ask permission before grabbing the keyboard
    • "Do you mind if I drive now?"
  • Silently count to 10 before interrupting with (e.g. a typo or syntax error)
    • Chances are that the driver will notice and fix it themselves