Pair programming with experienced developers
Pair programming with experienced developers will help you get up to speed more quickly than most other methods I have seen.
At the start of your career as a software developer, it is easy to feel unprepared, overwhelmed and, disconnected.
Pair programming with more experienced developers will help you get past these challenges.
Pair programming is your answer to learning the codebase faster, being connected and engaged and, having fun in the process.
What is pair programming?
Pair programming essentially means that two people write code together on one machine. One person is the driver and they write code. The other person is the observer and they review each line of code as it is typed in.
The two programmers switch between the driver and observer roles frequently as they pair program.
Pair programming is a very collaborative way of working and involves a lot of communication. While a pair of developers work on a task together, they do not only write code, they also plan and discuss their work. They clarify ideas on the way, discuss approaches and come to better solutions.
Why should I pair program with experienced developers?
Many benefits come from pair programming with more experienced developers.
When you pair program you get to observe the more experienced developer and learn a lot of things as you go. You can pick up how the experienced developer uses keyboard shortcuts or tools that you are not aware of. You can learn tips on programming language rules or overall design skills. It is an opportunity to learn their routine and how they use the same tools you use but in a more productive way.
The more experienced developer is likely to know about topics and techniques you do not know about. This eliminates delays in building solutions and builds up your knowledge of those topics than when compared to you working alone.
Pair programming allows you to receive more immediate feedback on your work from an experienced developer. You do not have to wait until another developer does a code review on your work at a later time. The feedback is immediate and you can learn and correct any issues in real-time which helps reinforce your learning. Receiving immediate feedback is also less frustrating than finding out much later that you need to re-do some work.
Pair programming allows you to examine a more experienced developer’s code and provide feedback, which is necessary to increase your ability to develop monitoring mechanisms for your learning activities. Pair programming helps you get better at learning.
Pair programming helps you practice the team skills that are central to good software development. You learn about the importance of good communication and collaboration. You learn about collective code ownership with your team. You learn about knowledge sharing between developers on a team. These are all important team skills to master along with your technical development.
Pair programming helps you remain focused on completing your work tasks. When you are working with another developer it is more difficult to get distracted and procrastinate with other unimportant tasks. The more experienced developer becomes your accountability buddy on the task you are working on.
How to pair program
The first thing you should do is identify experienced developers on your team and make them aware that you would like to pair program with them when they are available.
Most experienced developers will be willing to help you in your learning journey. Be patient with them as they can be busy with other work.
Once you have found an experienced developer to pair program with, you must identify the task you are going to be working on together. Before you start writing any code you should both understand the problem, come up with a draft solution and plan your approach. Write any steps to your solution down, they will be useful as you are coding the solution.
Once you start coding the task, you should take up one of the pair programming roles described earlier: driver or observer.
The driver is the person at the wheel, i.e. the keyboard. In this role, you will be focused on completing the tiny goal at hand, ignoring larger issues for the moment. You should always talk through what you are doing while doing it.
The observer is in the watching position, while the driver is typing. In this role, you will review the code on-the-go, give directions and share thoughts. You should also have an eye on the larger issues, bugs, and make notes of potential next steps or obstacles.
Rotate between the driver and observer roles with your pair programming partner. The suggested rotation formats are as follows:
Ping Pong Pairing
Pomodoro Pairing
Ping Pong Pairing - Software Developer A writes a failing automated test, Software Developer B writes the implementation to make it pass. Then they rotate and Software Developer B writes the failing automated test, Software Developer A writes the implementation to make it pass. And the cycle goes on, it is great for Test Driven Development (TDD).
Pomodoro Pairing - The driver is on the keyboard, writes the code focused on the tiny goal at hand while the observer reviews code on-the-go and keeps an eye on the bigger picture. The driver and observer switch roles in a defined amount of time like every 30 minutes.
The best way to learn is by doing. In the case of coding, that means typing and moving the mouse. So if you had to lean more into a pairing role as the less experienced software developer you should take up the driver role more often. Yes, it may be slow and frustrating sometimes but it will be beneficial for your learning.
Ask a lot of questions to the experienced developer during your pair programming sessions. Don't shy away from pair programming on tasks when you have no idea about the technology involved or the problem. If you keep working in the area that you feel most comfortable in, you will miss out on learning new things and ultimately spreading knowledge in your team.
How often to pair program
There isn’t one official answer to how often you should pair program.
Some companies pair program all the time - every line of production code written must be written by a pair. Other companies never pair program.
You will know what the culture is at your company and you can use that as a baseline of where to start. My advice is that given how beneficial pair programming is in your learning, you will want to do it as often as you can. So lean on the side of pair programming more often than not.
Things to watch out for
Paring forces you to be focused for longer periods, find common ground, and share a good wavelength with the other software developer. This is intense and gets you tired quickly. Exhaustion is one of the main challenges you will face as you pair program. Ensure you take frequent breaks with your pairing partner so you can keep your energy for a longer period.
Another thing to remember is to be considerate about your pairing partner’s personal space during your pair programming sessions. You will be working very closely together for possibly a long time so it is always important to be a great pairing partner.
Final thoughts
A note on remote pairing - Are you part of a distributed team, or some team members occasionally work from home? You can still practice pair programming, as long as both of you have reasonably stable internet access. Use video calling tool or shared IDEs. Being remote should not stop you from pair programming.
The best way to learn more about the benefits of pair programming is to see it in practice. So start today, identify an experienced developer on your team and ask them to pair program.
Pair programming with experienced developers will help you get up to speed more quickly than most other methods I have seen. It also helps to keep you connected and engaged.