> For the complete documentation index, see [llms.txt](https://yoan-thirion.gitbook.io/knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yoan-thirion.gitbook.io/knowledge-base/software-craftsmanship/practices/pair-programming.md).

# Pair Programming

## Connection - 10'

* In solo, list all the pros and cons of Pair Programming
* Share with the rest of the group

![](https://1936518372-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAffO8xa1ZWmgZvfeK2%2F-MRjFZHIcfGhksSZHsc6%2F-MRjG4YopxNoD9xlduSE%2Fimage.png?alt=media\&token=8c156aed-1af4-4fb3-9d61-9a34924b1afd)

## Concepts - 20'

* Watch this [video](https://www.youtube.com/watch?v=ET3Q6zNK3Io)
  * Ask them what they have seen
  * What are the other pros and cons explained
* Be sure that everyone has understood the roles : Drive / Navigator

| Pros                                            | Cons                 |
| ----------------------------------------------- | -------------------- |
| Instantly shared best practices / knowledge     | Tiring               |
| Improved design / code quality (fewer mistakes) | Can create frictions |
| Faster on-boarding                              |                      |
| Increase moral / confidence                     |                      |
| Increase team cohesion / collective ownership   |                      |
| Instant code reviews                            |                      |

* Pair programming is not 1 person sleeping and only one working.

![](https://1936518372-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAffO8xa1ZWmgZvfeK2%2F-MRjGT5tnHuUs24GlbHC%2F-MRjGXpK_gm_t5PldLZ3%2Fimage.png?alt=media\&token=4c722422-810a-40ed-b0f2-5faeec0b0a69)

### Different styles

![](https://1936518372-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAffO8xa1ZWmgZvfeK2%2F-MRjHDRcrp7OGmhFQeFA%2F-MRjHN9YjWehINkZDY4p%2Fimage.png?alt=media\&token=1989fa13-9aae-4d0c-9b2e-ab63e6fed022)

![](https://1936518372-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAffO8xa1ZWmgZvfeK2%2F-MRjHDRcrp7OGmhFQeFA%2F-MRjHY7PoRfLD8Gz0z5j%2Fimage.png?alt=media\&token=264ddfa0-db14-41c3-b703-fb854ae27d46)

![Ping pong when doing TDD](https://1936518372-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAffO8xa1ZWmgZvfeK2%2F-MRjHDRcrp7OGmhFQeFA%2F-MRjH_gIK9EmeddYFB0J%2Fimage.png?alt=media\&token=8407e39b-2d5e-43fd-9b32-c4a57e18bfc9)

### What about the cost of Pair Programming ?

* The Costs and Benefits of Pair Programming Alistair Cockburn & Laurie Williams
  * The development cost is approximately 15% higher
  * BUT this is repaid in :
    * Shorter and less expensive testing
    * Higher quality assurance
    * Less field support

![](https://1936518372-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAffO8xa1ZWmgZvfeK2%2F-MRjHqRxAExyXMWffq42%2F-MRjHyIJ9rrmv3iUa0PV%2Fimage.png?alt=media\&token=b200609c-8b16-428b-93b4-7f87f4c86a34)

## Concrete Practice - Create your check-list - 20'

* Think about key factors to make successful pair programming sessions
* Create a check-list

### Example of check-list :

* [ ] Communicate – without violence
  * To propose an idea : “I think...”&#x20;
  * To confirm agreement : “Do we agree...”&#x20;
  * To discuss progress towards goals : “We agree...”&#x20;
  * Avoid saying “No” / ”But”
    * Instead try saying, “Yes and...”&#x20;
  * Ask “What would it take to get you in..” if you’re disagree about a proposed idea&#x20;
* [ ] Talk / listen a lot
* [ ] Switch roles often
* [ ] Take breaks / Disconnect
* [ ] Chit chat when there is friction

## Conclusion - 5'

### How to start in your team ?

![Pair Programming Matrix from Jimmy Janlen](https://1936518372-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAffO8xa1ZWmgZvfeK2%2F-MRjHqRxAExyXMWffq42%2F-MRjIFCg8RbcSivz5Z4D%2Fimage.png?alt=media\&token=2153a7f0-35f8-4de1-b373-76eb02f84042)

* WHY ?
  * To do more pair programming
  * Visualize how much you pair during a week/sprint
* HOW ?
  * Whenever you’ve done a pairing session, make a tick in the corresponding box
