Slide 1

Slide 1 text

Pair Programming Rob Stearn @cocoadelica Delivery Manager at notonthehighstreet 2017 © cocoadelica.co.uk 1/38

Slide 2

Slide 2 text

— What is it? — Why do we need it? — Why does it work? — Why are we resistant to it? — How can we make it work? 2017 © cocoadelica.co.uk 2/38

Slide 3

Slide 3 text

What is it? — 2 people — 1 screen1 — 2 input devices2 — 1 task 2 Probably keyboards and mouses but needs and preferences vary. 1 One logical screen, as you might pairing with a remote colleague. 2017 © cocoadelica.co.uk 3/38

Slide 4

Slide 4 text

Driver Navigator 2017 © cocoadelica.co.uk 4/38

Slide 5

Slide 5 text

collaborate kəˈlabəreɪt - verb work jointly on an activity or project. "he collaborated with him on numerous hotel projects" synonyms: cooperate, join (up), join forces, team up, get together, come together, band together, work together, work jointly, participate, unite, combine, merge, link, ally, associate, amalgamate, integrate, form an alliance, pool resources, club together 2017 © cocoadelica.co.uk 5/38

Slide 6

Slide 6 text

2++? 2017 © cocoadelica.co.uk 6/38

Slide 7

Slide 7 text

"A committee is an animal with four back legs" — John Le Carre 2017 © cocoadelica.co.uk 7/38

Slide 8

Slide 8 text

Why do we need it? Be!er code Be!er people 2017 © cocoadelica.co.uk 8/38

Slide 9

Slide 9 text

Code wri!en by a human will inherit the traits of that human Mr. Spock (probably) 2017 © cocoadelica.co.uk 9/38

Slide 10

Slide 10 text

"The human eye has an almost infinite capacity for not seeing what it does not want to see . . . Programmers, if left to their own devices, will ignore the most glaring errors ... that anyone else can see in an instant"4 4 G. M. Weinberg, The Psychology of Computer Programming Silver Anniversary Edition. New York: Dorset House Publishing, 1998. 2017 © cocoadelica.co.uk 10/38

Slide 11

Slide 11 text

Pairing:! Solo:!!!!!! Defect density 2017 © cocoadelica.co.uk 11/38

Slide 12

Slide 12 text

LoRem ipsum dolor sit amEt sem. MAuris donec velit. Dignissim sed inceptos. Orci Aliquam amet vel Bit tempor scelerIsque. Elit sceLerisque mus erat sed lacus. Donec nunc lIgula. Justo egestas fusce. LecTus etiam eu eu maurYs a 2017 © cocoadelica.co.uk 12/38

Slide 13

Slide 13 text

The Pull Request process... 2017 © cocoadelica.co.uk 13/38

Slide 14

Slide 14 text

More confident: 90% Happier: 95% From a survey on pair programming,6 6 http://www.cs.utah.edu/%7Elwilliam/Papers/ieeeSoftware.PDF 2017 © cocoadelica.co.uk 14/38

Slide 15

Slide 15 text

Eliminating waste - Time waiting for code review - Duplicated effort - Reworking - Defect resolution - 'Rabbit holes' 2017 © cocoadelica.co.uk 15/38

Slide 16

Slide 16 text

Pairing: 60 mins Solo: 43 mins Time spent on an identical task5 5 On average 2017 © cocoadelica.co.uk 16/38

Slide 17

Slide 17 text

Why does it work? 2017 © cocoadelica.co.uk 17/38

Slide 18

Slide 18 text

Theory of distributed cognition 2017 © cocoadelica.co.uk 18/38

Slide 19

Slide 19 text

“Knowledge is commonly constructed through collaborative efforts toward shared objectives, or by dialogues and challenges brought about by differences in persons perspectives.” 2017 © cocoadelica.co.uk 19/38

Slide 20

Slide 20 text

2017 © cocoadelica.co.uk 20/38

Slide 21

Slide 21 text

Why are we resistant to it? 2017 © cocoadelica.co.uk 21/38

Slide 22

Slide 22 text

Fear Pride 2017 © cocoadelica.co.uk 22/38

Slide 23

Slide 23 text

Fear ... of looking foolish ... of conflict ... that sharing credit means losing recognition ... of own shyness/introversion ... of not being able to justify 2 developers to 1 task 2017 © cocoadelica.co.uk 23/38

Slide 24

Slide 24 text

Pride ... in thinking you're smarter ... in thinking you don't need help 2017 © cocoadelica.co.uk 24/38

Slide 25

Slide 25 text

Success results from the interplay between people. 2017 © cocoadelica.co.uk 25/38

Slide 26

Slide 26 text

How can we make it work? 2017 © cocoadelica.co.uk 26/38

Slide 27

Slide 27 text

Measure Can't justify pairing to your manager?7 Run some tests. — Find a reasonably complex task in your backlog. — Give it to a solo developer and a pair to work on. — Measure it from start to finish. — Include code review for the solo. — Encourage your team to discuss. — Be public with the results. 7 Other leadership ranks are available, YMMV 2017 © cocoadelica.co.uk 27/38

Slide 28

Slide 28 text

Prepare 1. Acknowledge it's not easy 2017 © cocoadelica.co.uk 28/38

Slide 29

Slide 29 text

2. Understand things will get worse before they get be!er 2017 © cocoadelica.co.uk 29/38

Slide 30

Slide 30 text

3. Know thyself. Know others. MBTI Insights DiSC 2017 © cocoadelica.co.uk 30/38

Slide 31

Slide 31 text

4. Consider the environment Desk layout? Hardware? Defined areas for pairing and solo work? 2017 © cocoadelica.co.uk 31/38

Slide 32

Slide 32 text

Practice Effective pair programmers hone the balance during an initial adjustment period. 2017 © cocoadelica.co.uk 32/38

Slide 33

Slide 33 text

Discipline Agree on a set of mutually accepted behaviours and hold each other to account. 2017 © cocoadelica.co.uk 33/38

Slide 34

Slide 34 text

- “Slide the keyboard/don't move the chairs”. - Communicate constantly. - Articulate your thought process. - Don't filter your ideas. - Regularly switch roles. - Take agreed breaks to check mail etc.. 2017 © cocoadelica.co.uk 34/38

Slide 35

Slide 35 text

Balance Optimum time for pairing is approx 60% 2017 © cocoadelica.co.uk 35/38

Slide 36

Slide 36 text

Measure again "Tell me how you will measure me, and I will tell you how I will behave." — Eliyahu Goldratt8 8 Business management expert on the application of the theory of constraints to various manufacturing, engineering, and other business processes. 2017 © cocoadelica.co.uk 36/38

Slide 37

Slide 37 text

— What is it? 2 people, collaborating on 1 task — Why do we need it? To ship better code & be better people — Why does it work? Distributed cognition beats isolated thinking — Why are we resistant to it? Fear and pride — How can we make it work? Listen to, understand and care about your colleagues 2017 © cocoadelica.co.uk 37/38

Slide 38

Slide 38 text

Rob Stearn @cocoadelica Thanks to Paypal UK Slides created in Deckset @decksetapp 2017 © cocoadelica.co.uk 38/38