Pair programming pros and cons for network automation

There is a trend in the technology industry in which software drives the configuration and operation of IT infrastructure, including networking. This means that software, instead of per-device configuration, drives network functionality. This transition to software is known as an infrastructure-as-code approach to network configuration, control and monitoring.

Organizations must ensure that the software that supports infrastructure as code incorporates both networking and software development best practices. A traditional approach is to teach software developers about networking or teach networking staff how to develop software, but this is a long-term process. An alternative option is pair programming.

Pair programming is a software development method in which two people work together at one workspace to write code. One person acts as the driver who writes the code, while the second person observes and navigates, providing feedback and next steps.

In the Agile software development world, pair programming teams consist of two developers. In the network automation and management world, a pair programming team consists of a developer and a networker. These teams are also applicable to other tasks, such as building network configuration templates or creating overall network designs, where the team would comprise two networkers.

This article refers to a software development person as a developer and a networking person as a networker.

Pair programming best practices

A network automation development team that comprises a developer and a networker enables staff members to learn from each other, while producing better software than either would create alone. The networker can help the developer understand networking functions, as well as how networking people think. This is particularly effective for developing UIs that make sense to networkers.

The dual perspective of software development and networking helps the team arrive at a better solution than if the members worked independently.

Conversely, the developer can teach the networker techniques for software development. The two can work as a team to arrive at a good design, selecting the best algorithms and data structures and decomposing the overall project into manageable modules. The design phase is important because good software starts with selecting the right abstractions.

It will undoubtedly take some time for the pair programming teams to get accustomed to working with each other, which can make early progress seem slow. As long as teams don’t have underlying problems, like personality conflicts, their productivity should increase over time.

The members of the pair need to swap roles frequently, providing each person with the opportunity to drive or to observe and comment. Each member needs to have at least basic software knowledge for pair programming to work. Many introductory software courses are available online at low or no cost to bring the networker up to a basic knowledge of the chosen programming language — typically, Python for network automation.

Pair programming pros and cons
Compare the advantages and disadvantages of pair programming.

The pros of pair programming

Pair programming can provide many advantages for the team involved and for the organization.

  1. Two heads are better than one. Two individuals viewing the same problem can quickly discuss alternatives and arrive at the best approach. The dual perspective of software development and networking helps the team arrive at a better solution than if the members worked independently. The networker can explain how to collect and display information, while the developer can recommend data structures, algorithms and abstractions that simplify the code.
  2. Replacement for code reviews. Pair programming replaces time-consuming and error-prone code reviews, in which a second party reviews the proposed software modules. With pair programming, the team reviews code in real time, which avoids rework. Of course, this requires both team members to have a good command of the programming language in use. If that’s not possible, a team of two developers and one networker may be a viable alternative.
  3. Cross-training. Pair programming team members learn from each other during the coding process. It’s an excellent way to share knowledge, both about software development practices and how networks function. Pair programming also facilitates the development of interpersonal skills, like communication and teamwork.

    Advanced software developers may at first feel that pair programming impedes progress, but they should be encouraged to give the process a chance. Ideally, the pair will quickly get to the point where the networker can contribute to the software development process, offering tips like the following:

    • “We should check for error condition X.”
    • “Could we put these two pieces of information side by side on the same screen?”
  1. Software maintenance. A significant benefit of pair programming is more than one person will understand how a piece of code works and its design criteria. This results in a better project memory that makes software easier and less expensive to maintain.
  2. Remote teams. Teams can pair program remotely, using teleconferencing systems with screen sharing. I’ve successfully used this mechanism with network design and troubleshooting tasks. The team members talk with one another as if they’re in the same physical room. This enables teams to remain productive even during times of restricted travel, such as during the current coronavirus lockdown.

The cons of pair programming

Pair programming has its disadvantages as well but not as many as the list of advantages.

  1. Personality conflicts. Some team members may not get along well with each other, which may require different pairings. There will occasionally be staff members who cannot work with anyone else, which will become apparent after multiple attempts.

    Both team members need to be comfortable with someone looking over their shoulder while writing code. It can take a few sessions before they become comfortable with each other. This may be the biggest adjustment pair programmers need to make. A more experienced developer will need to be patient with a less experienced partner who is creating code at a slow pace.

  1. Differences in experience and expertise. One team member may be significantly more advanced than the other. The pair programming approach may significantly reduce the total pace of development. However, working together enables the more advanced member to mentor the less experienced member, which can be an advantage in some situations. The less experienced partner can pick up on tips and techniques that the advanced team member uses to gain efficiencies.
  2. Isn’t it half as efficient? One might naturally think pair programming is half as efficient as when two people work separately, but surprisingly, studies have found it is only about 15% less efficient. It does, however, eliminate the need for code reviews, reduce bugs and produce better code. The net effect is pair programmers can be more efficient than separate developers who must then review each other’s code and go through more extensive integration, test and debug steps.

Understand the software development process

The biggest factor in a successful software project is spending the necessary time in the high-level software design phase. It is significantly more efficient to build the right software the first time. Developers who skimp on the design phase frequently have to discard an approach they spent time creating because they didn’t have a clear understanding of the requirements. Working through the design process enables teams to determine the overall algorithms and data structures they need to solve a given problem. Books like Rapid Development and Code Complete — both by Steve McConnell — can help guide your software development process to a successful conclusion.

It can take several weeks before pair programming teams gel and begin to see high levels of efficiency, so be patient. When carefully planned and with buy-in from the participants, pair programming practices can bring real benefits to the development of network automation systems.