Pair Programming - Be the best pair you can be

Preview:

Citation preview

David Morgantini

davidmorgantini.blogspot.co.uk

dmorgantini@gmail.com

Who Am I?

David Morgantini

Independent consultant

Previously worked for:

ThoughtWorks

Government Digital Services

Paid to write code for 9 years

Focus on Tech Leadership, Agile

Coaching & pragmatic delivery

Why are we here?

In Scope

Better understanding of the practice of

pair programming

Concrete tips on how to be more

effective while pair programming

Out of scope

A discussion on whether pairing is a

good practice

Tips on how to convince your team to

try/use pair programming

An overview of all the research on pair

programming

Overview

Some Definitions

Pairing patterns

Intended benefits

Avoiding disengagement

Common Definition

Let’s solve this

problem! Ok!

More definitions

Let’s use the

bits class to

get some bobs

That sounds

good.

Driver Navigator

Pairing Session

Disengagement

I am such a

good

developer!

I haven’t a clue

what’s going on.

What’s for dinner?

Players in a pairing session

I’ve worked on the

milking functionality

before.

Expert Novice

Glad he knows this

code, I’ve never

seen it before.

Players in a pairing session

But I’ve never had

to work the

DevOps*

Expert Novice

* DevOps is not a thing

Ah I know all

about the

DevOps*!

Players in a pairing session

But I’ve never had

to work the

DevOps*

Novice Expert

* DevOps is not a thing

Ah I know all

about the

DevOps*!

There can only be one

… and we add an

implementation

here …

You missed a semi-

colon.

There can only be one

Jerk. Keeps hogging

the keyboard. And

my neck hurts.

… and now watch

as I type these

seven new classes

Two keyboards

… let me explain by

driving for a bit!

Ah, now I

understand what

you’re trying to say!

Two keyboards

STOP TYPING

DAMNIT!WE DO THIS!

A Laptop

I don’t understand, I

can’t see. Pair

programming is stupid.

… the gubbins go

with the bits and

bobs…

Mirrored laptopI still don’t understand

but at least now I can

see! Pair programming

rocks!

… and then we

connect the bobs to

the ESB via the

night service …

Dual station

… You’ll be able to

connect to the

gubbins! We ROCK!

… so you’re saying

if I catch the night

service at line 135

Dual station

There is a problem

there!

La la la, looking at

my monitor, don’t

know what you’re

talking about

What does the research

say?Based on bug count,

pairing is equivalent to

solo programming.

Pair Programming

makes a major

positive difference.

Pair programming

is a hindrance.

Don’t use it.

I would be more

interested in looking

at the patterns of

interactions that can

lead to the benefits or

how they are lost.

Pair vacation

taking is

AWESOME!

Intended benefits of pairing

Economics

Design quality

Developer satisfaction

Learning/Knowledge transfer

Team building and communication

Economics

… create

loads of

gubbins!

… use the

gubbin

factory to …

Two people

doing one

person’s

work!?

Yep! Fewer bugs &

better design should

lead to lower long

term costs!

Quality

But how do

we connect

the gubbins

without one?

Maybe an

ESB is a

bad idea?

Excellent,

keep up the

good work!No new

bugs to

report, sir!

Developer satisfactionOk, no ESB. Let’s

use a light-weight

message queue

instead

Great idea!

Today was

AWESOME! WE ROCK!

HIGH

FIVE

Learning/Knowledge

sharing

I know this

code! I paired

with Jill!

Good thing we pair

cause I don’t know

what a gubbin is!

Communication

This would be a pain if

we had to use an

antiquated

communication method.

I hear ya!.

E-mail is so 2005.

WE ARE BUILDING BETTER

SOFTWARE!WE ARE BUILDING BETTER

SOFTWARE!

WE ARE BUILDING BETTER

SOFTWARE!

WE ARE BUILDING BETTER

SOFTWARE!

WE ARE BUILDING

BETTER SOFTWARE!

Systemic Benefits

Disengagement

I am such a

good

developer!

I haven’t a clue

what’s going on.

What’s for dinner?

Mutually agreed

disengagement… and while you do

that I’m going to

refactor the gubbin

factory.

I’m going to connect

up the message

queue

Expert-Novice

*whistling*

Expert Novice

I’m so confused

Expert-Novice

Do you

understand?

Expert Novice

No. Can you

please explain

more?

Reasons for disengagement

1) Type of work

1) Unfamiliar working environment

2) Interruptions

3) Time pressure

4) Social pressure

Type of work

I don’t think that

this work needs a

pair.

Ya. I’m not really

able to effectively

contribute

Suggestions

1) Consider tiny tasking

2) Break up the pair

3) Ask yourself if the work needs a pair

4) Expert: Ensure the novice is driving

Uncomfortable dev environment

I love EMACS!1!

Um… I can’t use

this insane text

editor

Suggestions

1) Make each pair feel ‘at home’

Dual monitors/keyboard etc…

Team IDE standardization

2) Expert: Take the comfort hit if the goal

is learning

InterruptionsHa ha! Free from the

old ball and chain!

When the cat’s away,

the ESB returns!Sorry, I

forgot.

You didn’t put

a new cover

sheet on your

TPS report!

Interruptions… and then

remember to add one

to combat the naming

problems …

I don’t know

what’s going

on anymore…

Suggestions

1) Try not to disrupt an in progress session

2) Complete any in progress discussion

before acknowledging interruption

3) Plan for longer interruptions

4) Re-establish mutual context when

interruption is complete

Time pressure

I feel the need…

the need for

speed.

Expert Novice

OMG. I lost him

25 minutes ago.

Suggestions

1) Plan novice pairing time into estimation

2) Expert: Verbalize progress and ask for

feedback

Social pressure

… and finally,

once we have

connected the

message

queue…

I don’t understand.

But I don’t want to

look stupid by

asking a question

Suggestions

1) Expert: Give novice partner some time to consider solutions alone before development starts

2) Novice: Stop your partner when you don’t know what’s going on

3) Expert: Encourage your partner to drive

4) Establish mutual context before starting development

Thank You!

What an

interesting group

of research

subjects.

So did you

learn anything

today?

I was busy

playing candy

crush.

He made 5

mistakes!!!!

GET BACK TO

WORK! I DON’T

PAY YOU TO SIT

AROUND AND

TALK!

Recommended