Unlocking the Power of Pair Programming — Lessons from Two Years at BestSecret Apps

Leopoldo Romacho
BestSecret Tech
Published in
10 min readOct 19, 2023

Beyond just coding, cooperation and collaboration are fundamental to software development. These days, fostering a culture of teamwork among engineers is essential. Sharing technical expertise is important, but equally crucial is open communication, working together to resolve issues, and supporting each other in achieving our project objectives. This has been a vital aspect of our remote working culture at BestSecret Apps.

These skills are even more important when we’re working together in Pair Programming. A method that has been really helpful in making remote work go smoothly for our teams — which is the standard way of working at BestSecret! Go remote!

After two years of utilising the combination of remote work and Pair Programming, we’re excited to share our experiences, lessons learned, and valuable insights with the community. Join us on this journey!

Photo by Desola Lanre-Ologun on Unsplash

What problems did we want to address?

Before embarking on our Pair Programming learnings journey, we need to address the key issues we were facing. Before defining solutions, the problems you needed to tackle had to be extremely clear.

Photo by Jackson Simmer on Unsplash

1. Knowledge silos

It happens frequently in a sprint for a software engineer to assume charge of a task. Thus, this person becomes the team member with the most knowledge. It’s quite likely that the same developer will oversee further development of that functionality. What we’ve accomplished after multiple iterations is the development of an information silo. Because knowledge belongs to the team and should never be owned by an individual, this is an issue.

2. Constant context switching through Pull Requests and lack of focus due to high concurrency

The norm in a workplace where we send pull requests to our coworkers is continual context swapping. This frequent context switching is currently one of the major obstacles for software development.

Additionally, waiting for someone to examine your pull request forces you to focus on something else, increasing the cognitive load on you and your team as you must manage several activities at once.

By dispersing our effort across multiple tasks in parallel, what we are actually doing is becoming less agile. This is because it takes more time to release small increments of work to gather feedback from the market or our customers.

These issues lead us to consider the following questions: Is Pair Programming really productive? Wouldn’t we increase productivity with two people working on separate tasks in parallel?

Are we really productive by using Pair Programming?

Some might say, with Pair Programming, you are actually wasting resources, as it involves two developers working on the same task simultaneously. Is this really true?

Photo by Carl Heyerdahl on Unsplash

To address this question, we must refer to three terms:

  • Efficiency — Utilisation — We are all busy doing things
  • Productivity — Getting things “done”
  • Effectiveness — Getting the “right” things done with the “right” quality

Therefore, the right question is:

How can you maximise your team effectiveness?

Waiting for responses is by far the biggest problem that may slow us down, and it precisely matches the waiting time for approval on our pull requests. After completing your code, you must wait until the other team member completes theirs. This waiting period drastically reduces your team’s efficiency.

Main benefits

1. Improved Code Quality: The constant communication between the Driver and the Navigator is the core of Pair Programming. These two offer a variety of viewpoints to the table, which leads to educated judgements and better code quality.

2. Code Homogeneity: When more eyes are on the code, agreements are forged and coding practices are standardised. Our shared understanding of the BestSecret Apps architecture, coupled with our team agreements, contributes to code homogeneity.

3. Knowledge Transfer: Pair Programming isn’t just about writing code; it’s about sharing knowledge. By working collaboratively, team members continuously learn from each other, reducing dependence on any single individual. This practice decreases knowledge silos, mentioned earlier, fostering a well-rounded team.

4. Accelerated Feedback Cycles: The quick feedback that Pair Programming offers is among its most important benefits. Our development cycles are sped up by this real-time correction and improvement process, making our teams more adaptable and flexible.

The roles

Each team member plays a crucial role that contributes to the success of the collaboration. These roles are designed to maximise software development efficiency and quality, ensuring that the process is smooth and productive.

Photo by Anne Nygard on Unsplash

Driver: Focuses on the short term. Is the one holding the “keyboard”. Explains what is being done and why. Constant communication is expected.

Navigator: Focuses on a strategic / mid term vision. Keeps in mind the big picture. Asks questions, suggest solutions, and review the Driver´s code.

Preparation is Key

We highlight a few crucial preparations before beginning a Pair Programming session:

1. Environment Setup: It might seems obvious, but you need to ensure all technical requirements are in place, the proper environment like a good audio quality in the room, headsets, as well as any other hardware you might need. Tools like Slack and Teams facilitate seamless communication during Pair Programming.

2. Collaborative Workspace: Create a comfortable environment for both the Driver and the Navigator An open space for sharing ideas or a Pair Programming IDE extension where you can both collaborate would be ideal. Be aware of your company’s privacy policy, as some tools store the code or work on third-party servers.

3. Roles and Expectations: Decide in advance who will take on the role of Driver and who will be the Navigator. Clearly define the session’s goals and expectations, and establish a rotation schedule for role-switching.

While we aim for frequent rotation between the Driver and Navigator roles, it truly depends on the pair. Some choose to switch after each Pomodoro, while others do so after four.

Furthermore, after a number of days, one member of the pair remains (who becomes the anchor of the task), and the other transitions to another task, promoting pair rotation. In finding the optimal timing for your team to change pairs, we’ve discovered that triggering pair changes with a maximum of one week’s work is advisable. This approach helps prevent one pair member from becoming the sole “owner” of a task.

4. Plan the ”work” in advance: The pair would check in advance the calendars and available slots so they can define how the work would be broken down. Does your partner have some meetings, so you have to work on your own for some time? Define what task you would focus on beforehand. Once the work is predetermined, the available pair member can concentrate on their part, with the intention of sharing the progress made in an isolated manner to the other pair once he/she becomes available. Obviously, this also applies in the case of your partner starting the working day earlier or having to leave for a doctor’s appointment temporarily!

How to handle breaks?

Managing breaks effectively is a crucial aspect of productivity, and among the various options we’ve explored, there is one particular technique we favour. The Pomodoro method, a widely recognised time management approach which is commonly adopted by our teams.

In essence, the group decides how long a Pomodoro should be, usually 50 minutes. The pair would concentrate on the Pair rogramming job during this Pomodoro. The two would take a break after each Pomodoro to relax, stretch, and respond to emails, Slack, etc. The two then begin a new Pomodoro. The two take a longer rest after four Pomodoros.

It’s important to note that while different teams have developed and apply different break approaches, but they all stick to the Pomodoro principle.

Maintaining Social Skills

Photo by John Schnobrich on Unsplash

In Pair Programming, effective communication and teamwork are equally as important as technical competence. To make this practise successful, the group should show the following key social skills:

1. Speak Clearly: Both participants are encouraged to articulate their thoughts and decisions clearly. Never presume that the Navigator knows what the Driver is thinking.

2. Conflict resolution: Disagreements of opinion are both acceptable and encouraged. In order to reach best solutions, we believe productive debates are essential. Feedback is important and should be given politely.

3. Effective Communication: Honest and constructive feedback is key for ongoing improvement. We prioritise open communication as the heart of our collaborative efforts.

4. Humility and a Learning Attitude: Success in Pair Programming relies on being open to learning from your partner. Humility is vital for effective teamwork and personal growth. Approach the session with the mindset that everyone’s contribution counts, regardless of seniority or experience. Every contribution helps improve the project and your professional development!

Ending the session strong

At the conclusion of each Pair Programming session, our teams focus on the following actions:

1. Code Review: Both participants review the code together to identify errors or areas for improvement. This collaborative review ensures a clean and optimised code base.

2. Reflection: It is important to take a moment to reflect on what we have learned. This self-reflection helps us apply our newly acquired knowledge to future commit iterations.

3. Completing a commit: Whenever possible, we leave the code base in a working state, even when roles are changed. This practice prevents problems in the pipeline and ensures a smooth handover.

Additional Tips

In addition to everything mentioned above, in our process, we’ve gathered a few more ideas that we would recommend to you.

Breaks: Maintaining discipline and establishing boundaries for breaks are important. Keep yourself from being sidetracked during Pair Programming sessions.

Adaptability: Modify the Pair Programming approach to fit the needs of your team and the nature of the task. Every squad is unique.

Collaborative Tools: Use screen-sharing and communication-facilitating collaborative tools when working remotely. Explore different options and choose the one that matches your needs best.

Mid-term advantages: Pair Programming has considerable long-term advantages in terms of efficiency and quality, even though it may appear slower at first.

Don’t be afraid to ask for assistance: If the two are unsure of how to move forward, don’t be afraid to consult your team architect or another team member for advice.

High complexity: When there is a significant degree of complexity or when team members need to share more expertise, think about utilising mob programming.

Continuous Learning and Adaptation

Our two-year journey with Pair Programming has not been without its challenges and learnings. We have refined our approach based on retrospectives, constantly striving for improvement.

Photo by Thought Catalog on Unsplash

Find below our most remarkable learnings:

  • Independent Work and Sync-ups: Pair Programming includes working independently with periodic sync-ups. The key here is that there are two minds working towards solving the same problem, it’s fine if you need to time on your own to consider the best options, there is no need to keep the microphone and camera connected constantly.
  • Roles and Responsibilities: Both roles should ensure they fulfil their responsibilities correctly, including the Driver’s ability to seek guidance from the Navigator when needed.
  • The Importance of Communication: Communication is crucial in Pair Programming, emphasising the need for constant dialogue among team members while coding.
  • Proactive Problem Solving: Be proactive and speak up if the session isn’t productive. Avoid shadowing (constant silence observation).
  • Senior-Junior Dynamic: Seniors, consider your partner’s experience and encourage juniors to take the Navigator role for growth.
  • Prioritizing Real Breaks: Pay more attention to REAL breaks where we can stand up, go for a coffee, etc.
  • Adapting to Odd Team Sizes: In cases of an odd number of team members, it’s acceptable to switch to Mob Programming or even independent work, with regular sync-ups to show how much we have progressed independently and gather feedback. Ideally, the individual working independently should concentrate on straightforward and repetitive tasks, with regular checks from their partner. It’s also important to rotate to prevent this individual from feeling isolated.
  • Smooth Onboarding for New Team Members: It makes it much easier for new team members to get onboarded quickly. It means they dive into the daily work of the team from day one. This helps them learn our practices and work together with us right away. New joiners get to see how we solve real problems and can start helping with projects faster. This approach speeds up how new members become part of the team and start doing useful work sooner.
  • Maintaining Quality: We managed to keep the same quality! Even as our team has nearly tripled in size and we’ve undergone a complete redesign of the application, incorporating new technologies such as Jetpack Compose or SwiftUI in different parts, we’ve succeeded in keeping our product nearly free of significant bugs. Our code quality has remained consistently high, as evidenced by our Sonar reports.
  • Optimising the Feedback Cycle: We have optimised our feedback cycle as we keep reducing distractions.

Pair Programming has now become a key foundation of our engineering culture at BestSecret Apps.

Over the last two years, we’ve fine-tuned our approach, reaching a level of proficiency and comfort with this collaborative practice. Our journey with Pair Programming has not only enhanced the quality of our software but also strengthened our team dynamics. As we move forward, we remain committed to the principles of effective communication, teamwork, and adaptability that Pair Programming has instilled in our processes. For us, it’s not just a practice, it’s a mindset that will continue to drive our software development practices.

Don’t hesitate to write a comment on what you agree or even disagree. Your thoughts and ideas would help all of us to keep growing professionally!

And finally… if you found interesting any of the topics described above or you would just like to dig deeper, let us know and we will be pleased to share further thoughts and experiences on it.

--

--