Part 2: Pair Programming Techniques
Part of the Pair Programming 101 Series
The Day I Learned There Are Different Styles
I thought pair programming was one thing: Driver types, navigator watches.
Then I joined a new team. First day, morning standup.
Tech lead: "Today we're doing ping-pong TDD on the auth service."
Me: "Wait... what?"
Turns out: There are multiple pair programming techniques. Each serves different purposes.
Let me show you the four techniques I actually use in production.
1. Driver-Navigator (Classic Pairing)
Most common approach. One person drives (types), the other navigates (thinks ahead).
How It Works
Driver responsibilities:
Write code
Think tactically (syntax, implementation)
Voice your thinking process
Ask questions when unclear
Navigator responsibilities:
Think strategically (architecture, edge cases)
Review code as it's written
Suggest improvements
Keep the big picture in mind
Rotation: Switch roles every 15-30 minutes.
Real Example: Building a User Service
My teammate Jake and I building user authentication:
Navigator caught:
Missing duplicate check
Security concern (bcrypt rounds)
Data leak (returning password hash)
All in real-time. No code review needed later.
When to Use Driver-Navigator
β General development work β Learning new codebase β Complex business logic β Code refactoring
My team uses this 70% of the time. Versatile and effective.
2. Ping-Pong Programming (TDD-Focused)
Developer A writes test. Developer B makes it pass. Switch.
Perfect for test-driven development.
How It Works
Developer A: Write a failing test
Developer B: Write minimal code to pass the test
Both: Refactor together
Switch roles
Repeat
Real Example: Building Validation Logic
My pairing session with Maria on user input validation:
Result: Thoroughly tested validation function. Both developers understand the code completely.
Complete User Validation Example
Full session with Sarah building user input validation:
Ping-pong led to:
Comprehensive test coverage
Edge cases discovered naturally
Both developers fully engaged
High-quality validation logic
When to Use Ping-Pong
β Test-driven development β Building utilities and helpers β Algorithm implementation β Security-critical code
I use this when test coverage is essential.
3. Strong-Style Pairing (Learning-Focused)
"For an idea to go from your head to the computer, it must go through someone else's hands."
Navigator has the idea. Driver implements exactly what navigator says.
Perfect for knowledge transfer.
How It Works
Navigator: Expert with the knowledge Driver: Learner who needs to understand
Navigator instructs, driver types. Driver can't implement their own ideas - only navigator's instructions.
Forces navigator to explain clearly. Forces driver to understand before typing.
Real Example: Teaching API Design
I'm teaching junior dev Tom about REST API design:
Tom (driver): "Why do we return 201 instead of 200?" Me (navigator): "201 means 'Created' - it's the semantic HTTP status for resource creation. 200 is generic success." Tom: "And we always need try-catch?" Me: "In async route handlers, yes. Otherwise unhandled promise rejections crash the server."
Tom learned:
REST conventions
HTTP status codes
Error handling patterns
Middleware usage
Request validation
All by typing it out while I explained.
When to Use Strong-Style
β Onboarding new developers β Teaching unfamiliar technology β Sharing domain knowledge β Mentoring sessions
I use this 2-3 times per week when mentoring.
4. Mob Programming (Team Collaboration)
Entire team (3-7 people) working on one problem together.
One driver, multiple navigators.
How It Works
One person drives (types code)
Everyone else navigates (discusses approach)
Rotate driver every 10-15 minutes
Decisions made by consensus
Real Example: Architecture Decision
Our team mob session deciding on microservices communication:
Team decision: Start with HTTP REST, plan for message queue migration if needed.
Mob programming gave us:
Multiple perspectives
Consensus on approach
Shared understanding
No knowledge silos
When to Use Mob Programming
β Architecture decisions β Complex problem solving β Critical infrastructure changes β Team alignment on approach
I use this once or twice per month for big decisions.
Choosing the Right Technique
My decision framework:
Real usage breakdown from my team:
Driver-Navigator: 70% of pairing sessions
Ping-Pong: 20% of pairing sessions
Strong-Style: 8% of pairing sessions
Mob Programming: 2% of pairing sessions
My Pairing Technique Evolution
Year 1: Only knew driver-navigator. Used it for everything.
Year 2: Discovered ping-pong TDD. Code quality improved dramatically.
Year 3: Learned strong-style for mentoring. Onboarding became 10x easier.
Year 4: Tried mob programming. Game-changer for architecture decisions.
Today: Use the right technique for each situation.
What's Next
In Part 3, we'll explore the tools that make pair programming effective:
VS Code Live Share setup
Remote pairing best practices
Communication tools
Git workflow for pairing
With real configuration examples and lessons from distributed teams.
Previous: Part 1 - Introduction to Pair Programming Next: Part 3 - Tools and Remote Setup β Series Home: Pair Programming 101
This article is part of the Pair Programming 101 series. All examples based on real pair programming experiences using TypeScript, Node.js, and modern development tools.
Last updated