Pair programming is a collaborative software-development practice in which two programmers work closely on the same code. In AI-assisted versions, one human works with a language model as a programming partner: the developer describes a task in natural language, receives autocomplete-style suggestions, and decides what to keep, revise, or reject. This arrangement is intended to complement human judgment rather than replace it. section 6.6 section 1.7
AI-assisted pair programming commonly supports these activities while retaining important limitations:
- Suggesting code as a developer types, filling repetitive patterns, offering alternatives, and converting comments or docstrings into code. section 1.7
- Producing a quick first implementation from a natural-language description, which can make iteration faster, especially for straightforward functions. section 6.6
- Assisting with testing, coding interviews, and communication for non-native English speakers, while still requiring review because complex tasks can fail. section 1.7 section 6.6
- Avoiding the assumption that greater autonomy is automatically better: autonomous systems can pursue dead ends for days that a human engineer would recognize quickly. section 1.7
- Considering security, transparency, and licensing concerns alongside productivity gains. section 1.7
A natural-language function request
A developer writes a comment or docstring describing what a function should do. The model proposes an implementation, and the developer evaluates it before continuing. A generated docstring can also accurately describe a function and its inputs, providing a compact example of the human-model interaction. section 6.6
Figure 6.4 The docstring produced by ChatGPT correctly describes the function given and each input.
Inspect the generated docstring example to see how an AI programming partner can describe a function and its inputs. section 6.6




