Pair programming typically delivers higher-quality, innovative applications, and it can lead to better employee experience and a happier, more dedicated workforce.
“Things go better when done together.” It’s one of the principles of the Harmonics Way, and it’s the principle behind pair programming. Pair programming is an agile software development technique where two programmers share a single workstation—one screen, keyboard, and mouse among the pair. It drives collaboration and knowledge transference and can result in innovative applications that may not have been achievable with just one developer. In this article, we’ll explore how pair programming developed and what it entails, analyze its benefits and challenges, and discuss some best practices for successful processes.
The practice of pair programming has been around for 20 years. In the early 2000s, authors Laurie Williams and Robert Kessler published the book Pair Programming Illuminated to discuss the practice and theory. Other articles and studies during that time discussed the topic of ping-pong programming, which is performed in conjunction with test-driven development. These collaborative styles help improve employee relationships, foster career development, and even enhance the enjoyment of coding in the workplace.
Pair Programming helps improve employee relationships, foster career development, and even enhance the enjoyment of coding in the workplace.
In pair programming, the programmer at the keyboard is usually called the “driver.” The other person is the “navigator,” someone who is actively involved in the programming task but also more focused on the overall direction of the project. The programmers are expected to swap roles every few minutes. Some experts say it’s a higher form of code review. Typical code reviews are like combining quality control and testing, where you’re waiting for someone else to review your code for defects or improvements to make. With pair programming, you have someone on hand to review your code instantly and regularly.
Pair programming comes with an abundance of advantages. The most obvious ones are improving collaboration, knowledge sharing, and code quality.
Developing a partnership can help your employees feel more connected to each other and the organization. This helps improve employee engagement and satisfaction, which are key to a thriving workforce.
Pair programming is a way to effectively share knowledge and skills among the team—specifically when a developer who is unfamiliar with a component is pairing with another who knows it much better, or a junior developer is learning from a more experienced developer.
Pair programming can also improve coding quality; when a technologist is talking things through out loud, they might be able to find complexities and hidden errors they might not have found otherwise. When programmers work with a partner out loud, they can brainstorm ideas, hold each other accountable, and stay on task.
Of course, pair programming does have its challenges you should be mindful of. Both participants need to be actively engaged through a paired session, otherwise it isn’t as effective. It also needs to be a programming-out-loud process where people verbally detail what they’re doing. Additionally, people mistakenly perceive pair programming as a process that incurs extra costs because there are two people involved. In fact, studies have shown that pair programming actually accelerates the coding process and usually results in better quality code. There are only opportunity costs if there is a bad programming pairing, but this is a worst-case scenario. Finally, it’s not a concept you can force your team to comply with. People may have dynamics and relationships that are less than ideal, so it’s important to mitigate those first before you pursue pair programming.
For effective pair programming collaborations, it’s important to set yourself up for success. One of the most important things you can do is to choose the pairings among your team carefully. You can even do a “preview project” where the pair works together to architect, code, and test their code. You can pair two experts or an expert and a novice for training and education. An expert-novice pairing could open the door to a mentorship. Make sure that your programmers are continually talking and are also switching roles often. It’s also important to determine whether each person is spending an equal amount of time typing. If you notice that one person seems to spend way more time typing when they’re supposed to be switching off and sharing the work, that’s an issue. You can set phone alarms at 20-minute intervals to ensure switching, and not have one person dominating the keyboard. Also, keep an eye on junior-senior pairings; try to keep the senior person from continuously snatching the keyboard from the junior person. The point is for the junior developer to listen, learn, and build upon their skill set.
The phrase “two heads are better than one” exemplifies the spirit of pair programming. This technique enables knowledge sharing and the acquisition of new skills, as well as improving team communication and employee relationships. Not only can pair programming result in higher-quality, innovative applications, but it can also lead to better employee experience and a happier, more dedicated workforce.