Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

Pair PRogramming

What is it?

  • Two people at one keyboard
  • Actively working together to solve the same problem
  • Switching the keyboard and mouse back and forth

Hmm, what if we try this *switch*

Ok, thats good, but don't forget to extract that into a method like this *switch*

Ah, that made me think of a test that will fail *switch*

What it isn't

  • Sit at my computer and watch as I code.
  • You take a turn working on this problem, then I'll do the next one.
  • I'll teach you how to code.

So really... How do we do this?

Step 4: SWITCH

Whenever it seems natural

At least every 30 minutes or so

Sometimes it is easier to speak in code

Why is it so hard?

Common Problems

Bad Pair Up

Not all pair ups are good. Like texting and driving.

BENEFITS

TIPS

  • There is no magic formula
  • Keep trying
  • Remember to switch keyboards
  • Try forcing the pair up
  • Pairing hours, pairing workstations
  • Give some personal time, or developers will revolt!

Increased Productivity

  • Two people are more effective at solving a problem than one
  • Less likely to get stuck
  • Less likely to get distracted
  • Synergy!

Training and Mentoring

  • Best way to learn is by doing
  • Pair up a weak developer with a strong one and watch him/her grow
  • Pair up two strong developers and they will learn from each other
  • Pair up two weak developers and...

Collective Ownership and Teamwork

  • Not Joe's code, our code
  • Each member feels like they can work in any part of the code
  • If Joe gets hit by a bus, someone else can still understand your dependency injection framework
  • The bug blame game, or crappy code blame game is not as fun

Reduced Bugs

  • Just in time code review
  • Two sets of eyes will catch more bugs
  • Less likely two people will go in the wrong direction
  • Pair up QA person and developer = GOOD!

Increased Understanding

Seems Easy Enough, but Why Do So Many Teams Struggle?

  • Team becomes cross trained
  • No more "roles" in the code
  • Expands even to testing, database and other tasks
  • Seeing the bigger picture by working on more pieces of the system

Don't forget to wear the same color shirts as your computer

so that everything matches

Becomes a watch me code Session

Takes practice to get the ryhthm

Takes time to see the benefits

Giving up Too Soon

Not invested into the work

Not Switching Roles

One person gets bored

It is much harder to pair program when the goals are NOT small and clear

TDD has a natural flow of repeated actions that work well with switching roles

Not Doing Test Driven DEvelopment

Step 1: Define your task

Step 2: Pick a small goal

Having a clearly defined task helps.

Should be able to be accomplished in 1 hour or 2.

Write a failing unit test

Refactor a method

Create a database table

Something small

Step 3: Do it, one person drives...

The other actively participates

No one is passive

Lots of talking, suggest names for variables, members, classes

Stay on task, but write down things you think of

Observer talks higher level, typer solves problem in code

Learn more about creating dynamic, engaging presentations with Prezi