Pair Programming
Overview¶
Periodically we will have you pair program. Pair programming is a development practice where two developers simultaneously work on the same code. It does not involve two developers, each on their own computer working on the same thing and talking back and forth. Instead, each person takes on a role. One, the 'Navigator', does not touch the keyboard, instead, they instruct the other, 'Driver', on what to do and guide them towards the solution. The driver is physically pressing the keys and writing the code, but is following the navigators instructions.
This is not an exercise in tedium, even though it can be frustrating at times.
We are practicing pair programming because many companies practice pair programming. Often more junior developers will be paired with seniors so that the junior can learn about the code base from a more experienced team member. Two developers of similar experience can also benefit from the practice by sharing their potentially limited knowledge, and reinforcing their own understanding of a subject by teaching their partner.
Arguably the most important reason to practice pair programming is that it will give you experience communicating with your partner about the code you are working on. One day, when you are the member of a development team, you will not be working in a vacuum, you will need to communicate your blocks, limitations, and hardships to your team. Shedding ego and displaying ignorance will enable you to be brought up to speed and empowered by your coworkers. Similarly, in the classroom you can both learn from and teach your pair.
Rules for Pair Programming:¶
Driver¶
- Codes only what directed by Navigator.
- Stop and get clarification as needed.
- To offer input, hands off keyboard until consensus is reached.
- Constant narration: code out loud (Navigator too).
Navigator¶
- Is responsible for communicating directions.
- Close your laptop.
- Never touches a keyboard, either Driver’s or their own.
- Driver Googles when it’s Google time.
Four Cs¶
- Check your ego at the door.
- Compromise.
- Communicate.
- Collaborate.