Effective Pair Programming

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

1. What is Pair Programming?

1.1. Definition

1.1.1. Style of programming

1.1.2. two programmers working side by side

1.1.3. 1 computer 1/2 keyboards 1/2 mice

1.1.4. Continually collaborate on design coding testing etc Work together High Communication High Focus Double checking work Planning the next step Solving the Problem Together

1.2. Roles

1.2.1. Driver The one typing at the computer Implementing the current test / solution Focused heavily on the syntax of the for loop etc Writing down a design

1.2.2. Navigator Observes the work of driver looking for defects strategic Planning the next step Ensuring the current implementation is going to work with the next design step Designing the next test to make pass Finding the best implementation for the next step Considering the best way to refactor current solution

1.3. How it Works

1.3.1. Lots of Communication Lots of Questions! Why are you doing it that way? What's the next step? How do you think we should do this? Should we test it this way? What if we try this? Lots of Pointing Finger (Don't touch the screen) Using the Mouse Nonverbal Grunting Laughing Crossed Arms Eye Rolling Come to an understanding on how pairing will work with a new pair Negotiate on what each person likes to do and how. What each does well etc Takes < 5 min Practice active listening Acknowledge, restate and summarize ideas

1.3.2. Constantly Switching Roles Ping Pong Programming Write the test, switch roles write both the test and implementation, switch roles Small Tasks Helps identifying switch points

2. Benefits of Pair Programming

2.1. Software Quality

2.1.1. Pair Negotiaion pair programmers arrive at the best solution together each brings their own set of skills, abilities and outlook both share the same goal for completing the task must 'negotiate' how to approach the problem jointly Pairs produce code with fewer defects Conclude that the end result is far better than anything they could have developed on their own

2.1.2. Pair Reviews 4 eyes are better than 2 Peer reviews are a heavy focus because they have been proven to find defects earlier The earlier a defect is found the cheaper it is to fix Pairing gives minute by minute peer review, the best way to find 'all' bugs as early as possible work done individually is often reassessed early and the better solution is implemented It's not too late to do what's right These are actual peer reviews vs many complaints of peer reviews not adding real value Not Just Feng Shui

2.2. Saved Time

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

2.2.2. Pair Pressure pair programmers put a positive form of pressure on each other Programmers admit to working harder and smarter because they do not want to let their partner down Improved adherence to procedures and team standards

2.2.3. Pair Courage Strength in numbers! tremendous courage builder giving us confidence to do things we might be afraid to do alone Teaching Analogy Courage to admit when we don't know something individually we may muddle through problems on our own, embarrassed to ask others questions Study shows 42% of developers are inclined to work on problems alone

2.2.4. Pair Debugging Most common use of pairing 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 The act of explaining the problems will often lead you to a solution Constant communication will increase this technique Also this bear will talk back

2.2.5. Interruptions Person out (sick, meetings, training...) Doesn't halt an entire task/story Pair can catch up when they are back Drive Bys People tend to interrupt less if you are working with someone else If you are interrupted

2.3. Knowledge Sharing

2.3.1. Knowledge is constantly being passed between partners tool usages tips programming language rules design and programming idioms how to approach problems Pair programmers know more about the overall baseline

2.3.2. Training New Team Members Costs are reduced in training as training time can reduce by a factor of two New people can actually contribute to projects quickly Teaching by doing, not showing, has been proven to be more effective

2.4. Strengthens Teams

2.4.1. Pair Trust Pairing allows team mates to open up to each other's knowledge and experiences get to know their team-mates much better builds trust and improves teamwork allows team to share more freely

2.4.2. Morale Pair programmers are happier programmers helps job retention Constant Team Building

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

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

3.2. Scrum

3.2.1. Ken Schwaber - Scrum Et Al

3.2.2. When you NEED something done You setup a team Give them the resources to do their job Let them decide how best to do their job You leave them alone and check status every few weeks

3.2.3. Don't do this when you HAVE to get stuff done Do it ALL the time This is called Scrum

3.3. Pair Programming

3.3.1. When you really NEED something done You work with someone else Together you debug/troubleshoot code Together you decide the best solution Together you implement and test

3.3.2. Don't do this when you HAVE to get stuff done Do it ALL the time This is called Pair Programming

4. Presenters

4.1. Nicholas Tuck

4.1.1. Pair Programming for 4 years

4.1.2. AFWWEBS / MetServices Developer 4 Years Team pairing full time for 2 years

4.2. Brandon McAllister

4.2.1. Pair Programming for 3 years

4.2.2. AFWWEBS / MetServices Developer 2 Years

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

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

5. Resources

5.1. Pair Programming Illuminated

5.1.1. Amazon Book

5.1.2. My Notes

5.1.3. SEMS owns 2 copies

5.2. C2 Pair Programming Wiki

5.2.1. Super awkward wiki

5.2.2. Lots of great pages, definitions, and ideas

6. Goals

6.1. Understand

6.1.1. WHAT Pair Programming is

6.1.2. Benefits of Pair Programming

6.1.3. Myths of Pair Programming

6.2. Learn some Techniques

7. Tips and Tricks

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

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

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

7.3. Handling Conflict

7.3.1. Navigator record contentious issues Review every half hour Allows progress

7.3.2. Separate for a period of time ~ 10 min Do separate investigation Get back together and discuss

7.3.3. Let the navigator drive for 5 minutes If driver agrees with the solution, driver can finish it out. Otherwise rollback Sometimes just trying can make both sides see the good and bad and lead to an agreement

7.4. Environment

7.4.1. Sit comfortably side by side Rotate sitting positions Or stand

7.4.2. Both can completely view monitors

7.4.3. 2 mice, 2 keyboard no more awkward mouse dance / accidental hand holding

7.4.4. Rearrange

7.5. Use test driven development

7.5.1. helps facilitate switching roles

7.6. Practice Humility

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

7.7. Take Breaks

7.7.1. check email, return phone calls, etc


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

7.8.2. Programmer's are stereotyped as quiet, but really we love to talk about what we are interested in... like programming This is not forcing introverts to be an extrovert, this is professionals excelling at what they do and showing colleagues their work

7.9. Be a Team Player

7.9.1. your partner's work == your work

7.9.2. Use the word "we" a lot

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

8. Myths of Pair Programming

8.1. The team productivity will be cut in half

8.1.1. reality Get two people programming in pairs and they'll work more than twice as fast as one could have Majority of buggy production code comes from individually written code A bug can range in effort dramatically so reducing bugs earlier saves an indeterminate amount of time very quickly 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 Navigator is doing more than syntax checks Navigator is holding the roadmap and is caught up with staying between the lines on a winding road Overall design is constantly being assessed and re-considered by navigator while driver implements the latest agreed on idea 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 Two experts solving complex problems will come up with a great solution, always better than what they would have come up with individually Two experienced programmers will fill many of each other's knowledge gaps everyone has gaps

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

8.4.1. reality ~50% spent pairing ~30% spent working alone ~20% spent working with more than 2

8.5. It will work well only with the right partner

8.5.1. reality Works well with most (though not all) Usually those with excess ego and/or a 'my way or the highway' attitude is the exception 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 Pairing is about better quality code and better solutions for the projects and benefits the team overall so desired personal success transitions to desired team success 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 Interruptions while working alone can make you lose context (all it takes is 15 seconds) A partner can help you get back into flow A pair is interrupted less than someone working individually "real work"does != better / less buggy / reliable / working code Mental blocks happen pairing helps prevent and work through them Surveys show 90% of those who pair enjoy programming more and feel more confident when pairing

9. Questions

9.1. Parking Lot