Skip to content

Instantly share code, notes, and snippets.

@yoching
Last active December 6, 2021 19:26
Show Gist options
  • Save yoching/0e647980dd28ad3bf75d0d585e2d7ecf to your computer and use it in GitHub Desktop.
Save yoching/0e647980dd28ad3bf75d0d585e2d7ecf to your computer and use it in GitHub Desktop.
Pair-Programming Introduction

Pair-Programming Introduction

Yoshikuni Kato


What is Pair-Programming?

  • Two people do programming together
  • Originated from Extreme Programming, which is one origin of Agile method

Typical styles

  • Ping-Pong
    • One write Unit Test, the other write the implementation
    • Suitable for a pair of same level developers
    • Suitable for Test-Driven-Development
  • Driver-Navigator
    • Driver: Write codes. Think about implementation details.
    • Navigator: Give advice about the implementation. Think about the entire logic flow.

Session flow

  • 1 session: 30-60 mins
  • First, declare a goal. What to implement, fix, refactor, ...
  • Driver-Navigator
    • Driver: write codes and speak what he/she is doing
    • Navigator: give advice, help driver when stuck, think about the entire flow
      • When driver seemed tired, interrupt and switch roles
    • Switch driver in 10-15 min or when tired

Pairing variations

  • Expert - Expert
  • Expert - Beginner
  • Beginner - Beginner
  • Programmer - Non-Programmer
  • ...

Pros

  • Effective knowledge sharing
    • How to think about logic, how to code, IDE usage, shortcuts, ...
    • Sometimes referred to as "the fastest way to share knowledge"
  • Owning code by the team
    • Knowing lots of parts leads to faster bug fix
  • Reducing time for code review
    • Changing whole logic at code review is difficult
  • Matching coding styles
  • Pretty Fun✨

Cons

  • Some engineers don't like
  • Might get tired at first
  • Takeing time?
    • However, there are some research that indicates it reduces time in the end

Setup - Not recommended

from Wikipedia - Pair programming

  • One monitor is not good for 2 people to watch.
  • Developers want to use their own keyboards and mice.
  • Navigator sometimes wants to use their own computer, e.g. when searching on the web

Setup - Better

  • 2 displays, 2 keyboards, 2 mice
  • Using screen sharing
    • Enabling keyboard & mouse control too
    • Remote tool or Mac functionality
  • Fancy environment
  • Some water

Minimizing Decision Fatigue to Improve Productivity


Screen sharing tools

Remote tool

  • Tuple Seems great! Specialized for pair-programming

Mac functionality (when in the same network)


Tips

  • Important to adjust based on the project/team situation
    • Doesn't have to be all the time
    • Effective when making new components or logic from scratch (rather than small changes)
    • Adjust ways by iteration
  • It might be hard at first
    • taking a break casually
    • switch driver/navigator when feeling tired (usually 10~15 min)

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment