What is Pair Programming?
Pair Programming is a technique used in Agile Development in which two Developers work together on one computer. One Developer writes the code, while the other Developer acts as an Observer or Navigator, reviewing each line of code that is being typed. The two switch roles frequently. The idea of Pair Programming first came about to ensure the quality of the code is to a good standard, with the use of the ‘Four Eyes’ principle, ensuring that two sets of eyes review the code.
- Senior and Senior. Even though you are a Senior, there are still things that can be learnt. Developing code with another Senior Developer can help you learn these things and view things differently.
- Senior and Junior. This is a great way to help a Junior learn more of code and the company. As long as work is balanced, and the Junior doesn’t end up just watching the Senior Developer.
- Junior and Junior. This combination can improve the knowledge of a Junior Developer. With both learning from each other and developing their skills faster.
Benefits of Pair Programming
- Safer/Higher Quality Code – With two brains focusing on the code, there is less chance of there being any errors.
- Better Team Knowledge – Pairing means there will be more communication. This can mean a better spread of knowledge across the team.
- Faster learning for Juniors – Juniors can learn much faster when paired with a more Senior Developer. Learning more of the code and the company.
- Save Time – With two Developers working on the code, each may have knowledge in different areas. Therefore, saving time looking for help.
Disadvantages of Pair Programming
- Time Consuming – If one Developer is unfocused or is a slow typer/thinker, this can slow down the other developer.
- More Talking, Less Coding – You could end up explaining things to other Developer, which would have been faster to just code.
- Lack of Ownership – If an error was to arise in the code, each Developer may feel the other is more responsible.
- Loss of Focus – With two Developers sat together, they could end up talking on an unrelated subject and lose focus on the task.
My Experience of Pair Programming
As I have been completing the Apprenticeship with my fellow apprentice, Michelle who also works at the same company, we have been able to code and work together. I feel this has helped massively throughout the year with each of us having different areas of knowledge and ways to help each other out. We both particularly worked together in the development of our Apprenticeship projects where we both showed each other different ways of completing tasks and fixing errors in our code. I feel this helped me finish the project in less time and to a higher quality.