Effective Pair Programming

Get Started. It's Free
or sign up with your email address
Rocket clouds
Effective Pair Programming by Mind Map: Effective Pair Programming

1. Presenters

1.1. Nicholas Tuck

1.1.1. Pair Programming for 4 years

1.1.2. AFWWEBS / MetServices Developer 4 Years

1.1.2.1. Team pairing full time for 2 years

1.2. Brandon McAllister

1.2.1. Pair Programming for 3 years

1.2.2. AFWWEBS / MetServices Developer 2 Years

1.3. AFWWEBS / Metservices Team pairing full time for 2 years

1.4. Sit by Andy Sedlacek, in front of Trent's office

2. Resources

2.1. Pair Programming Illuminated

2.1.1. Amazon Book

2.1.2. My Notes

2.1.3. SEMS owns 2 copies

2.2. C2 Pair Programming Wiki

2.2.1. Super awkward wiki

2.2.2. Lots of great pages, definitions, and ideas

3. What is Pair Programming?

3.1. Definition

3.1.1. Style of programming

3.1.2. two programmers

3.1.2.1. working side by side

3.1.3. 1 computer

3.1.3.1. 1/2 keyboards

3.1.3.2. 1/2 mice

3.1.4. Continually collaborate

3.1.4.1. on

3.1.4.1.1. design

3.1.4.1.2. coding

3.1.4.1.3. testing

3.1.4.1.4. etc

3.1.4.2. Work together

3.1.4.2.1. High Communication

3.1.4.2.2. High Focus

3.1.4.2.3. Double checking work

3.1.4.2.4. Planning the next step

3.1.4.2.5. Solving the Problem Together

3.2. Roles

3.2.1. Driver

3.2.1.1. The one typing at the computer

3.2.1.1.1. Implementing the current test / solution

3.2.1.1.2. Focused heavily on the syntax of the for loop etc

3.2.1.2. Writing down a design

3.2.2. Navigator

3.2.2.1. Observes the work of driver

3.2.2.1.1. looking for defects

3.2.2.1.2. strategic

3.2.2.2. Planning the next step

3.2.2.2.1. Ensuring the current implementation is going to work with the next design step

3.2.2.2.2. Designing the next test to make pass

3.2.2.2.3. Finding the best implementation for the next step

3.2.2.2.4. Considering the best way to refactor current solution

3.3. How it Works

3.3.1. Lots of Communication

3.3.1.1. Lots of Questions!

3.3.1.1.1. Why are you doing it that way?

3.3.1.1.2. What's the next step?

3.3.1.1.3. How do you think we should do this?

3.3.1.1.4. Should we test it this way?

3.3.1.1.5. What if we try this?

3.3.1.2. Lots of Pointing

3.3.1.2.1. Finger (Don't touch the screen)

3.3.1.2.2. Using the Mouse

3.3.1.3. Nonverbal

3.3.1.3.1. Grunting

3.3.1.3.2. Laughing

3.3.1.3.3. Crossed Arms

3.3.1.3.4. Eye Rolling

3.3.1.4. Come to an understanding on how pairing will work with a new pair

3.3.1.4.1. Negotiate on what each person likes to do and how. What each does well etc

3.3.1.4.2. Takes < 5 min

3.3.1.5. Practice active listening

3.3.1.5.1. Acknowledge, restate and summarize ideas

3.3.2. Constantly Switching Roles

3.3.2.1. Ping Pong Programming

3.3.2.1.1. Write the test, switch roles

3.3.2.1.2. write both the test and implementation, switch roles

3.3.2.2. Small Tasks

3.3.2.2.1. Helps identifying switch points

4. Goals

4.1. Understand

4.1.1. WHAT Pair Programming is

4.1.2. Benefits of Pair Programming

4.1.3. Myths of Pair Programming

4.2. Learn some Techniques

5. Tips and Tricks

5.1. If your navigator is getting bored, pass them the keyboard

5.1.1. If you both are tired, get up and walk around

5.2. If your partner is getting tired or frustrated, grab the keyboard

5.3. Handling Conflict

5.3.1. Navigator record contentious issues

5.3.1.1. Review every half hour

5.3.1.2. Allows progress

5.3.2. Separate for a period of time

5.3.2.1. ~ 10 min

5.3.2.2. Do separate investigation

5.3.2.3. Get back together and discuss

5.3.3. Let the navigator drive for 5 minutes

5.3.3.1. If driver agrees with the solution, driver can finish it out. Otherwise rollback

5.3.3.2. Sometimes just trying can make both sides see the good and bad and lead to an agreement

5.4. Environment

5.4.1. Sit comfortably side by side

5.4.1.1. Rotate sitting positions

5.4.1.2. Or stand

5.4.2. Both can completely view monitors

5.4.3. 2 mice, 2 keyboard

5.4.3.1. no more awkward mouse dance / accidental hand holding

5.4.4. Rearrange

5.5. Use test driven development

5.5.1. helps facilitate switching roles

5.6. Practice Humility

5.6.1. It's okay to not know something, admit it and start helping the team as best you can

5.7. Take Breaks

5.7.1. check email, return phone calls, etc

5.8. COMMUNICATE

5.8.1. 15 sec without talking is long, 30 sec is an eternity

5.8.2. Programmer's are stereotyped as quiet, but really we love to talk about what we are interested in... like programming

5.8.2.1. This is not forcing introverts to be an extrovert, this is professionals excelling at what they do and showing colleagues their work

5.9. Be a Team Player

5.9.1. your partner's work == your work

5.9.2. Use the word "we" a lot

5.9.3. If you don't understand something, ask, you are responsible for all of this work too

6. Benefits of Pair Programming

6.1. Software Quality

6.1.1. Pair Negotiaion

6.1.1.1. pair programmers arrive at the best solution together

6.1.1.1.1. each brings their own set of skills, abilities and outlook

6.1.1.1.2. both share the same goal for completing the task

6.1.1.1.3. must 'negotiate' how to approach the problem jointly

6.1.1.1.4. Pairs produce code with fewer defects

6.1.1.2. Conclude that the end result is far better than anything they could have developed on their own

6.1.2. Pair Reviews

6.1.2.1. 4 eyes are better than 2

6.1.2.2. Peer reviews are a heavy focus because they have been proven to find defects earlier

6.1.2.2.1. The earlier a defect is found the cheaper it is to fix

6.1.2.2.2. Pairing gives minute by minute peer review, the best way to find 'all' bugs as early as possible

6.1.2.3. work done individually is often reassessed early and the better solution is implemented

6.1.2.3.1. It's not too late to do what's right

6.1.2.4. These are actual peer reviews vs many complaints of peer reviews not adding real value

6.1.2.4.1. Not Just Feng Shui

6.2. Saved Time

6.2.1. Gelling pairs produce higher quality code in about half the time as individuals

6.2.2. Pair Pressure

6.2.2.1. pair programmers put a positive form of pressure on each other

6.2.2.1.1. Programmers admit to working harder and smarter because they do not want to let their partner down

6.2.2.1.2. Improved adherence to procedures and team standards

6.2.3. Pair Courage

6.2.3.1. Strength in numbers!

6.2.3.2. tremendous courage builder giving us confidence to do things we might be afraid to do alone

6.2.3.2.1. Teaching Analogy

6.2.3.3. Courage to admit when we don't know something

6.2.3.3.1. individually we may muddle through problems on our own, embarrassed to ask others questions

6.2.3.3.2. Study shows 42% of developers are inclined to work on problems alone

6.2.4. Pair Debugging

6.2.4.1. Most common use of pairing

6.2.4.2. Rubber Duck Debugging It is a common and effective practice to explain a problem to an inanimate object like a teddy bear or a rubber duck

6.2.4.2.1. The act of explaining the problems will often lead you to a solution

6.2.4.2.2. Constant communication will increase this technique

6.2.4.2.3. Also this bear will talk back

6.2.5. Interruptions

6.2.5.1. Person out (sick, meetings, training...)

6.2.5.1.1. Doesn't halt an entire task/story

6.2.5.1.2. Pair can catch up when they are back

6.2.5.2. Drive Bys

6.2.5.2.1. People tend to interrupt less if you are working with someone else

6.2.5.2.2. If you are interrupted

6.3. Knowledge Sharing

6.3.1. Knowledge is constantly being passed between partners

6.3.1.1. tool usages tips

6.3.1.2. programming language rules

6.3.1.3. design and programming idioms

6.3.1.4. how to approach problems

6.3.1.5. Pair programmers know more about the overall baseline

6.3.2. Training New Team Members

6.3.2.1. Costs are reduced in training as training time can reduce by a factor of two

6.3.2.2. New people can actually contribute to projects quickly

6.3.2.3. Teaching by doing, not showing, has been proven to be more effective

6.4. Strengthens Teams

6.4.1. Pair Trust

6.4.1.1. Pairing allows team mates to open up to each other's knowledge and experiences

6.4.1.1.1. get to know their team-mates much better

6.4.1.1.2. builds trust and improves teamwork

6.4.1.1.3. allows team to share more freely

6.4.2. Morale

6.4.2.1. Pair programmers are happier programmers

6.4.2.1.1. helps job retention

6.4.2.2. Constant Team Building

7. Nick's take on when to use Pair Programming

7.1. This is Nick's idea. Management is not telling you to use Pair Programming.... But I am

7.2. Scrum

7.2.1. Ken Schwaber - Scrum Et Al

7.2.2. When you NEED something done

7.2.2.1. You setup a team

7.2.2.2. Give them the resources to do their job

7.2.2.3. Let them decide how best to do their job

7.2.2.4. You leave them alone and check status every few weeks

7.2.3. Don't do this when you HAVE to get stuff done

7.2.3.1. Do it ALL the time

7.2.3.1.1. This is called Scrum

7.3. Pair Programming

7.3.1. When you really NEED something done

7.3.1.1. You work with someone else

7.3.1.2. Together you debug/troubleshoot code

7.3.1.3. Together you decide the best solution

7.3.1.4. Together you implement and test

7.3.2. Don't do this when you HAVE to get stuff done

7.3.2.1. Do it ALL the time

7.3.2.1.1. This is called Pair Programming

8. Myths of Pair Programming

8.1. The team productivity will be cut in half

8.1.1. reality

8.1.1.1. Get two people programming in pairs and they'll work more than twice as fast as one could have

8.1.1.2. Majority of buggy production code comes from individually written code

8.1.1.2.1. A bug can range in effort dramatically so reducing bugs earlier saves an indeterminate amount of time very quickly

8.1.1.3. Proved by a 16 week study at University of Utah

8.2. The navigator finds only syntax mistakes. Compilers can do that better than humans can

8.2.1. reality

8.2.1.1. Navigator is doing more than syntax checks

8.2.1.2. Navigator is holding the roadmap and is caught up with staying between the lines on a winding road

8.2.1.3. Overall design is constantly being assessed and re-considered by navigator while driver implements the latest agreed on idea

8.2.1.4. Also help brainstorm - brainstorming concludes good designs much faster than individual considerations

8.3. Pair Programming is good for training, but once you know what you're doing it is a waste of time

8.3.1. reality

8.3.1.1. Two experts solving complex problems will come up with a great solution, always better than what they would have come up with individually

8.3.1.2. Two experienced programmers will fill many of each other's knowledge gaps

8.3.1.2.1. everyone has gaps

8.4. I'll never get to work alone. I couldn't stand that!

8.4.1. reality

8.4.1.1. ~50% spent pairing

8.4.1.2. ~30% spent working alone

8.4.1.3. ~20% spent working with more than 2

8.5. It will work well only with the right partner

8.5.1. reality

8.5.1.1. Works well with most (though not all)

8.5.1.1.1. Usually those with excess ego and/or a 'my way or the highway' attitude is the exception

8.5.1.2. Managed approaches to the different dynamics of pairs are well described in the Pair Programming Illuminated book

8.6. I'll never get credit for doing anything. I'll have to share all the recognition with my partner

8.6.1. reality

8.6.1.1. Pairing is about better quality code and better solutions for the projects and benefits the team overall

8.6.1.1.1. so desired personal success transitions to desired team success

8.6.1.1.2. individual success means nothing without team success

8.7. Only time I ever get any real work done is when I'm alone

8.7.1. reality

8.7.1.1. Interruptions while working alone can make you lose context (all it takes is 15 seconds)

8.7.1.1.1. A partner can help you get back into flow

8.7.1.2. A pair is interrupted less than someone working individually

8.7.1.3. "real work"does != better / less buggy / reliable / working code

8.7.1.4. Mental blocks happen

8.7.1.4.1. pairing helps prevent and work through them

8.7.1.5. Surveys show 90% of those who pair enjoy programming more and feel more confident when pairing

9. Questions

9.1. Parking Lot