Development is a field that relies heavily on—and benefits heavily from—collaboration. One of the ways in which this takes place is through pair coding, or writing code with another person. No matter the experience level, there is something to be gained from this sort of teamwork. In September of 2021, one of the Ingage teams included Phil, a developer with now 5 years under his belt, and Alyssa, who was fresh out of a coding bootcamp where she had spent 14 weeks learning the building blocks of development. Despite differing experience levels, they both learned a lot from pair coding, including more about the code itself, how to effectively pair code, how to teach, and tricks for quick learning.
As mentioned, pair coding involves two people collaborating to write code together. This typically looks like one person typing while the other dictates. The pair also thinks through problems together. Working together in this way leads to less mistakes. In fact, studies show that pair coding results in 15% fewer defects. Additionally, it provides an opportunity to learn from each other and help leverage each other’s strengths and experiences. When working in a full stack application, perhaps one teammate is more experienced with frontend technologies while the other has spent most of their career working in the backend. There are clean coding tips and best practices that can be shared as the pair codes, too. Ultimately, this practice not only leads to cleaner code, it can also add knowledge and tools to the respective teammates' toolboxes.
No matter your skill level there can be some initial level of discomfort when pair programming. Treading through the maze of a new relationship and finding out what working formats work best for you can be difficult, especially when working with someone who is more junior or has less domain knowledge than you. Because Phil was partnered with a brand new developer fresh from a bootcamp, his mentality into pair programming was to ensure that she could be a better developer than he was at her current level of experience. Drawing from all of his early fumbles, remembering what it was like to be at that level, and providing an environment where it was truly collaborative was instrumental in successful pair programming. Not all people learn the same way so while Phil may have struggled in one concept, Alyssa may pick it up relatively quickly. Conversely if there is a topic that Alyssa was having difficulty understanding then Phil would stop and check to see where the blocker is. Taking the time to go over an issue, while it may impact velocity, is always more beneficial in the long run. Technology, and specifically software development, has progressed by leaps and bounds since its inception but on the whole most concepts stay generally consistent as languages evolve and the value in understanding the fundamentals will always outweigh short term gain. Therefore, it’s important to take the time to lay a solid foundation and encourage growth and learning.
Thus, beginning this project with nothing but her 14 weeks in bootcamp, Alyssa worked to capitalize on the learning experience that pair-coding offered, and used this and other tools as ways to become a contributing member of the team. During important pair coding sessions—such as learning the code base–she asked her teammate if she could record the session. This allowed her to be fully present and she could walk back through the recording to become more familiar with the project. Additionally, after a session where she learned something new, she would write out her understanding of the process and what was going on. Putting the ‘why’ or ‘how’ down on paper and working on articulating the solution—even just to herself—helped solidify the concepts in her mind. Finally, of course, she asked a lot of questions—and there will always be more to come.
In all, pair coding and collaborating not only improves code, but it can also create a healthy learning environment and set a team and individuals up for success. This example followed developers of differing experience levels, but even two similarly experienced developers have different career and education journeys, and can therefore learn from the practice. Pair coding helps to elevate both the code and each other’s understanding, thus proving, two heads are better than one.
1 Robert C Martin cites these studies in his book, Clean Craftsmanship, pg 244:
“Strengthening the Case for Pair Programming” by Laurie Williams, Robert R. Keller, Ward Cunningham, and Ron Jeffries, IEEE
Software 17, no. 4 (2000), 19-25; “The Case for Collaborative Programming” by J.T. Nosek, Communications of the ACM 41, no. 3