pair programming
/ˈpeə ˌprəʊ.ɡræm.ɪŋ/noun
Pair programming is a practice in which two developers work on the same programming task together. One writes code while the other considers the approach and reviews the work as it happens.
The developers chose pair programming for the complex migration so they could discuss design decisions immediately.
In pair programming, two developers work together on one task and the same code. They often share a computer, but can also work remotely through screen sharing or a shared development environment. Both contribute ideas and actively work on the solution.
Driver and navigator
The developer writing the code is usually called the driver. The navigator follows along, thinks ahead and asks questions about the approach, edge cases or readability. These roles are not fixed: the developers switch regularly so both understand and influence the solution.
Pairing can help with complex logic, unfamiliar parts of a Glossary · In briefcodebaseA codebase is the collection of source code used to build and maintain a software product or component.Read more or work where knowledge transfer matters. Two developers are spending time on one task simultaneously, so the team decides for each task whether that direct collaboration is worth the combined time.
How it differs from a code review
In a Glossary · In briefcode reviewA code review is an assessment of a code change by another developer. They check its behaviour, readability, and maintainability, among other things, before the change is merged.Read more, a colleague usually assesses a change after its author has written it. Pair programming provides that review during coding. Questions and possible errors are discussed immediately, while the solution is still being formed.
The two practices can complement each other. A pair can write code together and then ask someone who was not involved to review it. This adds a fresh perspective and helps keep the solution understandable for the rest of the team.