Pair Programming: Two Scary Words

By Bill Scott

eXtreme Programming (XP) is making a comeback in the software development world. As software is getting more complex the industry requires a higher quality of code. Pair Programming and Test Driven Development (TDD) are the tent-pole practices of XP and there is indisputable evidence that these practices help a team produce better code faster.

For more than 20 years of my consulting career, I have carefully avoided any engagement that included formal Pair Programming. I thought that I understood what Pair Programming was and it sounded bad: being shackled to another code monkey for 8 hours, slowing me down, looking over my shoulder all day. it just sounded like a bummer.

I have been practicing XP and Pair Programming for the past 9 months and it has been an incredible experience. Our team is happy, we have fun, we communicate well, we solve problems together and produce awesome, clean code. Personally, I have levelled-up my coding skills and learned a lot from my team. I thought I would dedicate a few paragraphs to explain what Pair Programming really is.

Pair Programming is like it sounds, 2 developers solving the same problem on a same computer. Ideally the pair would have 2 monitors, keyboards and mouse(s).

Pair Programming has structure. Each programmer assumes a role: driver or navigator. The driver types and the navigator reviews.

The pair collaborates on the problem to be worked on, agrees on a strategy, then starts coding.

The driver explains the approach as she types, constantly communicating and basically thinking aloud. This practice is also known as “rubber ducking” when practiced alone. It takes practice to express your problem solving skills verbally, especially when you’ve done it silently for years. This technique is incredible as it helps validate your logic before code is even written.

The navigator listens to the driver’s explanation, watches as the code unfolds and may challenge the logic or correct the code. The navigator’s role is to review and collaborate and to challenge.

The pair focuses on writing simple code that is directly related to the story they are working on. Each pair must respect each other and offer positive feedback as well as fact-based challenges. Roles should be switched often throughout the day.

Pair Programming only works if the team embraces the XP values: simplicity, communication, constructive feedback, respect, courage.

  • Courage: team needs to have the courage to fail and the ability to learn from failure. no gloating or heckling, failures should be celebrated and shared otherwise they will be buried and repeated.
  • Respect: team members should have respect for each other, every coder is unique, respect diversity in thought and action. Pairs also must have respect for other pairs and trust they can get the job done. Bullying should not be tolerated.
  • Feedback: constructive feedback is essential for growing and learning. Feedback should be fact-based without emotional content.
  • Communication: it is built into the pair practice but must be within the team as well, pairs should be able to communicate with other pairs easily for quick questions or advice.
  • Simplicity: Pairs should strive to write simple code, stories should be as simple as possible.
  • Pair Programming is hard for experienced programmers to embrace because it’s scary. It requires courage to openly reveal our thought process and sometimes admit that we don’t have the answer. It requires self-confidence, your code is constantly being reviewed, as you type. It requires patience and humility as you are challenged by your partner.

    In general Pair Programming brings your professional coding skills to the next level. It gives you a new perspective on your own style and skill level and helps you see your strengths and areas of improvement. It makes the day less frustrating as you approach blockers as a team(or pair) with the power of 2 minds. It gives you a better understanding and respect for your co-workers. In general, pair programming helps an experienced programmer experience the joy of coding again.

    author

    About the author

    Bill Scott is a Transformation Engineer at TribalScale, helping highly skilled developers adapt to the ever changing software development landscape. He embraces the values and principles of extreme programming while building elegant solutions using emerging technology like Cloud Foundry, Kafka and React.

    Join our fast growing team and connect with us on Twitter, LinkedIn, Instagram& Facebook! Learn more about us on our website.

    Visit Us on Medium

    You might also be interested in…