Looking into widely used technique through a junior developer’s perspective
Pair programming is a collaborative software development technique in an agile environment where two developers work on the same task together. This approach is managed by one developer being the driver, who writes the code and the other developer being the navigator, who reviews each line of code that is written by the driver. It is also beneficial to have switched between the navigator and the driver to increase productivity and develop their skills by being in both positions.
A Great Tool For Collaboration
At this stage, I think it is important to discuss the Visual Studio Code’s Live Share feature. Due to the new realities after Covid-19, jobs are being remotely held. Even though two developers are not in the same workspace, they could still achieve pair-programming through the Live Share feature. The driver could share the link through live share and the navigator would be able to follow the lines of codes and whenever they have to switch, they would be able to do that as well. I believe that this feature is one of the many ways to achieve successful pair programming during remote work.
Having the Right Mindset
An important criteria in pair-programming is to have the right mindset before beginning pair programming. Partners should be comfortable with each other and should be open to new ideas. It does not matter how experienced you are, you should be open to new paths and learn from your partner to increase the productivity of pair programming. Sometimes, if you are a junior developer and your partner is more experienced than you, this should not push you back as well. You should always remember that you are pair programming to share your knowledge and learn from each other's experiences. Also, you should never blame each other during the pair programming process because at the end of the day, you are there to build a great product together and you have the same mission together.
Advantages & Disadvantages
Now is the right time to discuss the pros and cons of pair programming. Some advantages of pair programming are sharing knowledge, improving code quality, and increasing time efficiency. On the other hand, there might be challenges too such as communication and participation.
No matter you are a junior or senior developer, it's always good to share your knowledge and also learn from your partner's knowledge. This approach could help you build different perspectives to tackle the same problem. Furthermore, by sharing your knowledge, you think aloud, so certain conclusions and advice could be made during the process together with your partner.
Improving Code Quality
During pair programming, the navigator reviews each line of code so this process decreases the number of bugs and also the code review is done instantly during the process. As two partners are tackling the challenge together, the number of bugs will decrease with two pairs of eyes trying to catch bugs.
Increasing Time Efficiency
As two heads are working on the same development, this would decrease the time spent on the task. Both partners would share their knowledge and think loud on how to tackle the problem so this would help them spend less time on the problem by tackling together.
As we discussed above, if the right mindset is not built, there might be challenges too such as communication and participation.
The navigator should always be actively engaged by giving comments and directions. Both partners should think aloud while tackling the problem. There should be always an ongoing process between the partners by thinking out loud and sharing ideas with each other. Otherwise, communication could be a challenge and would decrease the efficiency of pair programming.
Another challenge could be involving both partners in the pair programming process. Both partners should be open to each other, otherwise, if the relationship between the partners is poor, then the pair programming activity wouldn’t be beneficial for both sides. You cannot just build productive pair programming session or force partners to be involved in the session through their issues. Jessie Leung states in her article that, “Pairing demands both parties be equally invested, open, and focused for the benefits to be realised.” I totally agree with this idea, both partners should be united to realize the benefits.
Does Pair-Programming Increases The Cost?
A controversial topic on pair programming is that whether pair programming increases the cost of development or not. As two developers try to tackle the same task, it might seem that this process increases the cost. However, according to the paper The Costs and Benefits of Pair Programming that was written in 2000, even though pair programming increases time cost, however, this increment goes down and gets balanced due to the prevention of bugs. I also agree with this idea, because pair programming decreases the number of bugs we have, so there would be less time spent on the bugs on later stages which decreases the time cost of development. Therefore, even though pair programming might seem that it increases the development cost, by preventing bugs, actually it balances the time cost.
Weblab Technology shared recent statistics in their Pair Programming Guide article about pair programming surveys:
“Around 96% of the pair programmers reported in an online survey that they enjoyed their work in a pair programming environment than working alone.”
“Also, 95% of the surveyed developers declared that they felt more confident when they worked in pairs than when they worked alone.”
Jr. Developer’s Perspective On Pair-Programming
Looking back at my previous pair programming sessions, the first thing I want to underline is that I totally agree with the statistics above. I felt more confident during the pair programming session and we both enjoyed the work together. We solved the problem in less amount of time compared to my previous tackles. I learnt new ways of tackling tasks and my perspective was broadened. Also by thinking out loud while writing my code, it made me see a clearer version of my code. The number of bugs was also decreased. Therefore, I can say that I enjoyed my pair programming sessions until now.
I think that what made me like pair programming was also about being lucky with my partners. I had cool partners during my pair programming sessions where good communication was built and we were open to new ideas, concepts, perspectives and challenges together. We had a clear ambition that we wanted to tackle the task in the best way we could. Therefore, having the same ambitions, clear communication and being open to new ideas together with my partner helped me to enjoy my pair programming sessions and also be confident on the way.
I would recommend engaging more in pair programming sessions. This technique will enhance your skills and you will see how far you can go with the help of other partner’s knowledge. Also before pair-programming, leave your ego on aside and try to build good communication with your partner. Be open, and be willing to learn anything new from the session. Especially if you are a junior developer, this technique will help you climb the stairs quickly and you will see that your skills are developed.