SlideShare una empresa de Scribd logo
1 de 65
Introducing Pair Programming


                  Steve Smith
                  Senior Architect
                  The Code Project
                  http://SteveSmithBlog.com
                  Twitter: @ardalis
Our Sponsors

Platinum

Gold
Silver

Other
http://www.flickr.com/photos/menlopics/3928250043/
It’s We not Me
Pairing is part of a larger process…


Becoming a software development TEAM.
Pair Programming
      Who
      What
     Where
     When
      Why
      How
Who Pairs?




             http://www.flickr.com/photos/isafmedia/4990043858/
             http://www.flickr.com/photos/thenationalguard/4535036556/
             http://www.flickr.com/photos/flyforfun/3264854289/
             http://www.flickr.com/photos/bestinplastics/4893299962/
             http://www.flickr.com/photos/wonderlane/315466291/
Who Should Pair?
http://www.flickr.com/photos/svet/4641090741
http://www.flickr.com/photos/elefevre/4373756868/
Who Shouldn’t?
• “One of the reasons I wanted to be a programmer, is so
  I don’t have to deal with people all the time!”
   – If you don’t like dealing with people, you have worse
     problems than Pair Programming
• “The other guy smells!”
   – Get him to get a job at a non-agile shop.
• “Why should I play secretary and type in the code as it
  is dictated to me?”
   – You shouldn’t, that’s not Pair Programming. If your
     partner is failing to think strategically and is instead
     dictating code to you, hand them the keyboard.
                                                 http://c2.com/cgi/wiki?PairProgrammingDoubts
• “The other guy thinks too slowly; I don’t want
  to be a teacher all day long!”
  – If you teach well, they will speed up over time
  – Change pairs; all day is too long to pair with one
    person.
• “The other person types so slowly, I get
  impatient!”
  – Patience is a virtue; learn it.
  – Typing competently is a virtue; learn it.

                                         http://c2.com/cgi/wiki?PairProgrammingDoubts
What is Pair Programming?
Pair Programming
Two programmers develop software side by side
  at one computer.

• Also known as collaborative programming

• Each person in the pair generally plays the role
  of either Driver or Navigator at any given time
• Roles shift back and forth frequently
Pair Programming
• Pair programming is a social skill that takes
  time to learn.

• Pair programming is not mentoring, but two
  people working together as equals
  – Of course, working together at one computer is
    also an excellent mentoring practice
http://www.extremeprogramming.org/map/code.html
Where is Pair Programming done?
Where
• Best with co-located teams

• Best with sufficient space for two people to
  work comfortably at one computer

• Try to create a team room. Tear down cubicle
  walls. Eliminate L- and U-shaped desks.
http://www.flickr.com/photos/halfaloafoftofu/413474322/
More Bad Layouts
Better Layouts
Ideal Layouts - Tables
Team Rooms
Pair Workstations
When should you pair?
When should you pair?
•   Complex code
•   Mission-critical code
•   Code that involves design decisions
•   Areas of code that you want everyone on the
    team to know how to work with
    – Keep your truck number high
You do this already
• When you ask for help with a tricky bug
• When you run a new design by a teammate
• When you have someone look over that scary
  database update you’re about to run

• You know it works.
When shouldn’t you pair?
•   Mundane tasks
•   Fixing simple typos
•   Spikes
•   When distracted
    – Checking email, twitter, facebook, etc
• You’re sick!
    – Stay home! Or at least in your own workspace!
Todd asks:
“During an ‘average’ day, what would be an
  appropriate amount of time to pair program?
  Entire day? Several hours at a time? Are
  there diminishing returns if two people spend
  too much time together during the day?”

When should you switch pairing partners?
When should you switch roles?
Ping Pong Pairing
Ping Pong Pairing
• Alice (Pilot) writes a failing test
[Roles Switch]
• Bob (new Pilot) writes the smallest amount of
  code possible to make the test pass.
• Bob refactors if needed (with Alice’s input)
• Bob writes a failing test for the next bit of
  functionality
[Roles Switch]
Ping Pong Pairing

DEMO
Pomodoro Technique
• Do Focused Work for 25 minutes
• Use a timer
• Take a 5-minute break

• Take a longer break after several work periods
• Switch Pilot/Navigator every 25 minutes
• Switch partners regularly, too (2-4 times/day)
Why?
Benefits
• Better code
• Knowledge transfer / sharing
• More fun – better morale
• Higher productivity – fewer distractions and
  blocks
• Improved communication and team
  cooperation
More Benefits
• Continual review
• Improved design
• Fewer defects
• Minimized personnel dependencies and info
  silos
• Builds a true TEAM
• Rapidly integrates new hires
Do the math
• It doesn’t take twice as long
  – Studies show 15% overhead imposed
• It produces fewer defects and better designs
  – Fewer bugs when shipped (15%)
  – More flexible system when it needs to change
• Improves team morale and employee
  satisfaction
  – Less turnover
  – Larger truck factor
How?
How does it work?
•   Collaborate
•   Respect one another
•   Set up your workspace so you can be effective
•   Alternate roles frequently
•   Stay engaged and communicate frequently
    – Think out loud
• Wait 10 seconds before pointing out any typo
    – Be patient with your partner
Be a good Driver
•   Focus on the task
•   Do the simplest thing that can possibly work
•   Talk through your thought process as you go
•   Refactor if you and Navigator agree it’s time
    – Only when tests are green
    – Don’t forget to refactor the tests!
Be a good Navigator
• Stay involved – pay attention
• Review the code
• Make notes about things that you’ll need to
  come back to later
  – Let Driver focus on task at hand
• Consider the big picture, not the syntax
  – Consider alternatives; is this the right approach?
• Keep Driver disciplined and writing Clean
  Code!
How do you decide what to work on?
Some options:
• Pairs grab the next story from the queue together.

• Alternate which pair member chooses the story to be
  worked on

• Whoever asks someone to pair with them has already
  determined the task to work on

• Assign stories to pairing stations, not to individuals.
How does it work with more than 2?
How do you do it remotely?
Tools for Remote Pairing
Voice and Screen   Files
• Skype            • Source Control
• GoToMeeting      • Dropbox
• LiveMeeting
                   • Live Sync / Live Mesh

Screen Only
• Mikogo
• Crossloop
• VNC
How do you convince management?
It reduces productivity!
• When people say that Pair Programming
  reduces productivity, I answer "that would be
  true if the most time consuming part of
  programming was typing" -- MartinFowler
Take the long view
                        Experienced
                        with Pairing:
Just Learning to Pair   15% overhead
Take the long view
                 From 70% to 85%. 15%
                 raw change; 21% better.
Take the long view
Take the long view
• 15% increase in code development time
• 15% reduction in defects
Example:
    A 50,000 LOC application might take 1000 hours to
    develop. Pairs might take 15% longer: 1150 hours.
    Assume a bug rate of 100 per 1000 lines of code, but a
    thorough process removes 70% of these. That leaves
    1500 bugs in the individuals’ code. Collaborators with
    15% less would have 1275, or 225 fewer bugs.
 If each bug were to take just an hour to fix (which is low)
    you still come out ahead.
How: Source Control
Who checks out the code if you’re in pairs?

• Practice Collective Code Ownership
  – User per Workstation
  – User per Pair
  – Switch Users Per Checkin and Per Role Change


• Worst case: Note collaborator in comments
Parting Thoughts
Introducing… the PairOn
You’re Doing It Wrong




                        http://www.flickr.com/photos/shadowstorm/3985346700
References
•   http://en.wikipedia.org/wiki/Pair_programming
•   http://www.slideshare.net/Siddhi/intro-to-pair-programming
•   http://www.slideshare.net/jlangr/pair-programming-talk-presentation
•   http://www.slideshare.net/rogercafe/pair-programming-presentation
•   http://www.slideshare.net/rachellaycock/pair-programming-good-bad-and-ugly
•   http://www.slideshare.net/dennisdoomen/the-10-habits-of-highly-effective-programmers
•   http://www.codinghorror.com/blog/2007/11/pair-programming-vs-code-reviews.html
•   http://en.wikipedia.org/wiki/Pomodoro_Technique
•   http://collaboration.csc.ncsu.edu/laurie/Papers/XPSardinia.PDF
Pair Programming - Summary
•   Catch more mistakes as they are typed
•   Improve software design
•   Solve problems faster
•   Learn and transfer knowledge better
•   Create an real team
•   People enjoy their work more
Discuss




          Find me online:
          SteveSmithBlog.com
          Twitter: @ardalis

Más contenido relacionado

La actualidad más candente

Kanban/Scrumban - taking scrum outside its comfort zone
Kanban/Scrumban - taking scrum outside its comfort zoneKanban/Scrumban - taking scrum outside its comfort zone
Kanban/Scrumban - taking scrum outside its comfort zoneYuval Yeret
 
Agile methodology
Agile methodologyAgile methodology
Agile methodologyTyler Rose
 
Scrum to Scrumban Migration
Scrum to Scrumban MigrationScrum to Scrumban Migration
Scrum to Scrumban MigrationSkills Matter
 
Life cycle of user story: Outside-in agile product management & testing, or...
Life cycle of user story: Outside-in agile product management & testing, or...Life cycle of user story: Outside-in agile product management & testing, or...
Life cycle of user story: Outside-in agile product management & testing, or...Ravi Tadwalkar
 
バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携
バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携
バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携慎一 古賀
 
社内Java8勉強会 ラムダ式とストリームAPI
社内Java8勉強会 ラムダ式とストリームAPI社内Java8勉強会 ラムダ式とストリームAPI
社内Java8勉強会 ラムダ式とストリームAPIAkihiro Ikezoe
 
What is agile model?Working of agile model
What is agile model?Working of agile modelWhat is agile model?Working of agile model
What is agile model?Working of agile modelzoomers
 
Agile methodology v 4.5 s
Agile methodology   v 4.5 sAgile methodology   v 4.5 s
Agile methodology v 4.5 sJames Sutter
 
Scrum vs Kanban | What are the differences between Scrum and Kanban | Edureka
Scrum vs Kanban | What are the differences between Scrum and Kanban | EdurekaScrum vs Kanban | What are the differences between Scrum and Kanban | Edureka
Scrum vs Kanban | What are the differences between Scrum and Kanban | EdurekaEdureka!
 
카카오스토리 웹팀의 코드리뷰 경험
카카오스토리 웹팀의 코드리뷰 경험카카오스토리 웹팀의 코드리뷰 경험
카카오스토리 웹팀의 코드리뷰 경험Ohgyun Ahn
 
このPHP QAツールがすごい!2019
このPHP QAツールがすごい!2019 このPHP QAツールがすごい!2019
このPHP QAツールがすごい!2019 sasezaki
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignIrwansyah Irwansyah
 
Implementing Kanban to Improve your Workflow
Implementing Kanban to Improve your WorkflowImplementing Kanban to Improve your Workflow
Implementing Kanban to Improve your WorkflowJennifer Davis
 
Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Anshul Vinayak
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
 
できる!並列・並行プログラミング
できる!並列・並行プログラミングできる!並列・並行プログラミング
できる!並列・並行プログラミングPreferred Networks
 

La actualidad más candente (20)

Kanban/Scrumban - taking scrum outside its comfort zone
Kanban/Scrumban - taking scrum outside its comfort zoneKanban/Scrumban - taking scrum outside its comfort zone
Kanban/Scrumban - taking scrum outside its comfort zone
 
Agile methodology
Agile methodologyAgile methodology
Agile methodology
 
Scrum to Scrumban Migration
Scrum to Scrumban MigrationScrum to Scrumban Migration
Scrum to Scrumban Migration
 
Clean Code
Clean CodeClean Code
Clean Code
 
Life cycle of user story: Outside-in agile product management & testing, or...
Life cycle of user story: Outside-in agile product management & testing, or...Life cycle of user story: Outside-in agile product management & testing, or...
Life cycle of user story: Outside-in agile product management & testing, or...
 
バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携
バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携
バックログとタスクをインポート・エクスポート Team Foundation Server と Excel・Project との連携
 
Kanban Basics
Kanban BasicsKanban Basics
Kanban Basics
 
社内Java8勉強会 ラムダ式とストリームAPI
社内Java8勉強会 ラムダ式とストリームAPI社内Java8勉強会 ラムダ式とストリームAPI
社内Java8勉強会 ラムダ式とストリームAPI
 
Scrum vs kanban
Scrum vs kanbanScrum vs kanban
Scrum vs kanban
 
What is agile model?Working of agile model
What is agile model?Working of agile modelWhat is agile model?Working of agile model
What is agile model?Working of agile model
 
Agile methodology v 4.5 s
Agile methodology   v 4.5 sAgile methodology   v 4.5 s
Agile methodology v 4.5 s
 
Scrum vs Kanban | What are the differences between Scrum and Kanban | Edureka
Scrum vs Kanban | What are the differences between Scrum and Kanban | EdurekaScrum vs Kanban | What are the differences between Scrum and Kanban | Edureka
Scrum vs Kanban | What are the differences between Scrum and Kanban | Edureka
 
Pair Programming
Pair ProgrammingPair Programming
Pair Programming
 
카카오스토리 웹팀의 코드리뷰 경험
카카오스토리 웹팀의 코드리뷰 경험카카오스토리 웹팀의 코드리뷰 경험
카카오스토리 웹팀의 코드리뷰 경험
 
このPHP QAツールがすごい!2019
このPHP QAツールがすごい!2019 このPHP QAツールがすごい!2019
このPHP QAツールがすごい!2019
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven Design
 
Implementing Kanban to Improve your Workflow
Implementing Kanban to Improve your WorkflowImplementing Kanban to Improve your Workflow
Implementing Kanban to Improve your Workflow
 
Code Smells and Its type (With Example)
Code Smells and Its type (With Example)Code Smells and Its type (With Example)
Code Smells and Its type (With Example)
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 
できる!並列・並行プログラミング
できる!並列・並行プログラミングできる!並列・並行プログラミング
できる!並列・並行プログラミング
 

Similar a Introducing Pair Programming

Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Derek Jacoby
 
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...Technical Agility institute
 
Agile Software Development
Agile Software DevelopmentAgile Software Development
Agile Software DevelopmentAhmet Bulut
 
Pair Programming Styles
Pair Programming StylesPair Programming Styles
Pair Programming StylesAttila Bertók
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)Mike Harris
 
Redesigning everything (avanscoperta meeutp edition)
Redesigning everything (avanscoperta meeutp edition)Redesigning everything (avanscoperta meeutp edition)
Redesigning everything (avanscoperta meeutp edition)Alberto Brandolini
 
Limiting WIP - Global Scrum Gathering Denver 2022
Limiting WIP - Global Scrum Gathering Denver 2022Limiting WIP - Global Scrum Gathering Denver 2022
Limiting WIP - Global Scrum Gathering Denver 2022Wm. Hunter Tammaro
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): RevistedMike Harris
 
Software Craftsmanship - It's an Imperative
Software Craftsmanship - It's an ImperativeSoftware Craftsmanship - It's an Imperative
Software Craftsmanship - It's an ImperativeFadi Stephan
 
Pair Programming - Everything you need to know
Pair Programming - Everything you need to knowPair Programming - Everything you need to know
Pair Programming - Everything you need to knowKristina Suchan
 
Mob Programming for Continuous Learning
Mob Programming for Continuous LearningMob Programming for Continuous Learning
Mob Programming for Continuous LearningMike Clement
 
Software Development Whats & Whys
Software Development Whats & Whys Software Development Whats & Whys
Software Development Whats & Whys Harun Yardımcı
 
How to get started with Site Reliability Engineering
How to get started with Site Reliability EngineeringHow to get started with Site Reliability Engineering
How to get started with Site Reliability EngineeringAndrew Kirkpatrick
 
Surviving the technical interview
Surviving the technical interviewSurviving the technical interview
Surviving the technical interviewEric Brooke
 

Similar a Introducing Pair Programming (20)

Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
 
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
Demystifying pair programming, swarming and mob programming - Shrikant Vashis...
 
Agile Software Development
Agile Software DevelopmentAgile Software Development
Agile Software Development
 
Pair Programming Styles
Pair Programming StylesPair Programming Styles
Pair Programming Styles
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)
 
Redesigning everything (avanscoperta meeutp edition)
Redesigning everything (avanscoperta meeutp edition)Redesigning everything (avanscoperta meeutp edition)
Redesigning everything (avanscoperta meeutp edition)
 
Limiting WIP - Global Scrum Gathering Denver 2022
Limiting WIP - Global Scrum Gathering Denver 2022Limiting WIP - Global Scrum Gathering Denver 2022
Limiting WIP - Global Scrum Gathering Denver 2022
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
 
Software Craftsmanship - It's an Imperative
Software Craftsmanship - It's an ImperativeSoftware Craftsmanship - It's an Imperative
Software Craftsmanship - It's an Imperative
 
Lecture 25
Lecture 25Lecture 25
Lecture 25
 
Specification by example
Specification by exampleSpecification by example
Specification by example
 
Pair Programming - Everything you need to know
Pair Programming - Everything you need to knowPair Programming - Everything you need to know
Pair Programming - Everything you need to know
 
Mob Programming for Continuous Learning
Mob Programming for Continuous LearningMob Programming for Continuous Learning
Mob Programming for Continuous Learning
 
Software Development Whats & Whys
Software Development Whats & Whys Software Development Whats & Whys
Software Development Whats & Whys
 
eXtreme Programming
eXtreme ProgrammingeXtreme Programming
eXtreme Programming
 
Pair Programming and XP Values
Pair Programming and XP ValuesPair Programming and XP Values
Pair Programming and XP Values
 
How to get started with Site Reliability Engineering
How to get started with Site Reliability EngineeringHow to get started with Site Reliability Engineering
How to get started with Site Reliability Engineering
 
Surviving the technical interview
Surviving the technical interviewSurviving the technical interview
Surviving the technical interview
 

Más de Steven Smith

Clean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by ArdalisClean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by ArdalisSteven Smith
 
Finding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design PatternsFinding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design PatternsSteven Smith
 
Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018Steven Smith
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Steven Smith
 
Introducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashIntroducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashSteven Smith
 
Most Useful Design Patterns
Most Useful Design PatternsMost Useful Design Patterns
Most Useful Design PatternsSteven Smith
 
Improving the Design of Existing Software
Improving the Design of Existing SoftwareImproving the Design of Existing Software
Improving the Design of Existing SoftwareSteven Smith
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Steven Smith
 
Decoupling with Domain Events
Decoupling with Domain EventsDecoupling with Domain Events
Decoupling with Domain EventsSteven Smith
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016Steven Smith
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Steven Smith
 
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingBreaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingSteven Smith
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5Steven Smith
 
My Iraq Experience
My Iraq ExperienceMy Iraq Experience
My Iraq ExperienceSteven Smith
 
Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?Steven Smith
 
Domain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCSteven Smith
 

Más de Steven Smith (20)

Clean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by ArdalisClean architecture with asp.net core by Ardalis
Clean architecture with asp.net core by Ardalis
 
Finding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design PatternsFinding Patterns in the Clouds - Cloud Design Patterns
Finding Patterns in the Clouds - Cloud Design Patterns
 
Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018Introducing domain driven design - dogfood con 2018
Introducing domain driven design - dogfood con 2018
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
 
Introducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemashIntroducing Domain Driven Design - codemash
Introducing Domain Driven Design - codemash
 
Most Useful Design Patterns
Most Useful Design PatternsMost Useful Design Patterns
Most Useful Design Patterns
 
Improving the Design of Existing Software
Improving the Design of Existing SoftwareImproving the Design of Existing Software
Improving the Design of Existing Software
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0
 
Decoupling with Domain Events
Decoupling with Domain EventsDecoupling with Domain Events
Decoupling with Domain Events
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016
 
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingBreaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit Testing
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5A Whirldwind Tour of ASP.NET 5
A Whirldwind Tour of ASP.NET 5
 
Domain events
Domain eventsDomain events
Domain events
 
My Iraq Experience
My Iraq ExperienceMy Iraq Experience
My Iraq Experience
 
Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?Add Some DDD to Your ASP.NET MVC, OK?
Add Some DDD to Your ASP.NET MVC, OK?
 
Domain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVC
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Introducing Pair Programming

  • 1. Introducing Pair Programming Steve Smith Senior Architect The Code Project http://SteveSmithBlog.com Twitter: @ardalis
  • 4. It’s We not Me Pairing is part of a larger process… Becoming a software development TEAM.
  • 5. Pair Programming Who What Where When Why How
  • 6. Who Pairs? http://www.flickr.com/photos/isafmedia/4990043858/ http://www.flickr.com/photos/thenationalguard/4535036556/ http://www.flickr.com/photos/flyforfun/3264854289/ http://www.flickr.com/photos/bestinplastics/4893299962/ http://www.flickr.com/photos/wonderlane/315466291/
  • 11.
  • 12. • “One of the reasons I wanted to be a programmer, is so I don’t have to deal with people all the time!” – If you don’t like dealing with people, you have worse problems than Pair Programming • “The other guy smells!” – Get him to get a job at a non-agile shop. • “Why should I play secretary and type in the code as it is dictated to me?” – You shouldn’t, that’s not Pair Programming. If your partner is failing to think strategically and is instead dictating code to you, hand them the keyboard. http://c2.com/cgi/wiki?PairProgrammingDoubts
  • 13. • “The other guy thinks too slowly; I don’t want to be a teacher all day long!” – If you teach well, they will speed up over time – Change pairs; all day is too long to pair with one person. • “The other person types so slowly, I get impatient!” – Patience is a virtue; learn it. – Typing competently is a virtue; learn it. http://c2.com/cgi/wiki?PairProgrammingDoubts
  • 14. What is Pair Programming?
  • 15. Pair Programming Two programmers develop software side by side at one computer. • Also known as collaborative programming • Each person in the pair generally plays the role of either Driver or Navigator at any given time • Roles shift back and forth frequently
  • 16. Pair Programming • Pair programming is a social skill that takes time to learn. • Pair programming is not mentoring, but two people working together as equals – Of course, working together at one computer is also an excellent mentoring practice
  • 18. Where is Pair Programming done?
  • 19. Where • Best with co-located teams • Best with sufficient space for two people to work comfortably at one computer • Try to create a team room. Tear down cubicle walls. Eliminate L- and U-shaped desks.
  • 20.
  • 21.
  • 25. Ideal Layouts - Tables
  • 28.
  • 30. When should you pair? • Complex code • Mission-critical code • Code that involves design decisions • Areas of code that you want everyone on the team to know how to work with – Keep your truck number high
  • 31. You do this already • When you ask for help with a tricky bug • When you run a new design by a teammate • When you have someone look over that scary database update you’re about to run • You know it works.
  • 32. When shouldn’t you pair? • Mundane tasks • Fixing simple typos • Spikes • When distracted – Checking email, twitter, facebook, etc • You’re sick! – Stay home! Or at least in your own workspace!
  • 33. Todd asks: “During an ‘average’ day, what would be an appropriate amount of time to pair program? Entire day? Several hours at a time? Are there diminishing returns if two people spend too much time together during the day?” When should you switch pairing partners?
  • 34. When should you switch roles?
  • 36. Ping Pong Pairing • Alice (Pilot) writes a failing test [Roles Switch] • Bob (new Pilot) writes the smallest amount of code possible to make the test pass. • Bob refactors if needed (with Alice’s input) • Bob writes a failing test for the next bit of functionality [Roles Switch]
  • 38. Pomodoro Technique • Do Focused Work for 25 minutes • Use a timer • Take a 5-minute break • Take a longer break after several work periods • Switch Pilot/Navigator every 25 minutes • Switch partners regularly, too (2-4 times/day)
  • 39. Why?
  • 40. Benefits • Better code • Knowledge transfer / sharing • More fun – better morale • Higher productivity – fewer distractions and blocks • Improved communication and team cooperation
  • 41. More Benefits • Continual review • Improved design • Fewer defects • Minimized personnel dependencies and info silos • Builds a true TEAM • Rapidly integrates new hires
  • 42. Do the math • It doesn’t take twice as long – Studies show 15% overhead imposed • It produces fewer defects and better designs – Fewer bugs when shipped (15%) – More flexible system when it needs to change • Improves team morale and employee satisfaction – Less turnover – Larger truck factor
  • 43. How?
  • 44. How does it work? • Collaborate • Respect one another • Set up your workspace so you can be effective • Alternate roles frequently • Stay engaged and communicate frequently – Think out loud • Wait 10 seconds before pointing out any typo – Be patient with your partner
  • 45. Be a good Driver • Focus on the task • Do the simplest thing that can possibly work • Talk through your thought process as you go • Refactor if you and Navigator agree it’s time – Only when tests are green – Don’t forget to refactor the tests!
  • 46. Be a good Navigator • Stay involved – pay attention • Review the code • Make notes about things that you’ll need to come back to later – Let Driver focus on task at hand • Consider the big picture, not the syntax – Consider alternatives; is this the right approach? • Keep Driver disciplined and writing Clean Code!
  • 47. How do you decide what to work on? Some options: • Pairs grab the next story from the queue together. • Alternate which pair member chooses the story to be worked on • Whoever asks someone to pair with them has already determined the task to work on • Assign stories to pairing stations, not to individuals.
  • 48. How does it work with more than 2?
  • 49. How do you do it remotely?
  • 50. Tools for Remote Pairing Voice and Screen Files • Skype • Source Control • GoToMeeting • Dropbox • LiveMeeting • Live Sync / Live Mesh Screen Only • Mikogo • Crossloop • VNC
  • 51. How do you convince management?
  • 52. It reduces productivity! • When people say that Pair Programming reduces productivity, I answer "that would be true if the most time consuming part of programming was typing" -- MartinFowler
  • 53. Take the long view Experienced with Pairing: Just Learning to Pair 15% overhead
  • 54. Take the long view From 70% to 85%. 15% raw change; 21% better.
  • 56.
  • 57. Take the long view • 15% increase in code development time • 15% reduction in defects Example: A 50,000 LOC application might take 1000 hours to develop. Pairs might take 15% longer: 1150 hours. Assume a bug rate of 100 per 1000 lines of code, but a thorough process removes 70% of these. That leaves 1500 bugs in the individuals’ code. Collaborators with 15% less would have 1275, or 225 fewer bugs. If each bug were to take just an hour to fix (which is low) you still come out ahead.
  • 58. How: Source Control Who checks out the code if you’re in pairs? • Practice Collective Code Ownership – User per Workstation – User per Pair – Switch Users Per Checkin and Per Role Change • Worst case: Note collaborator in comments
  • 61.
  • 62. You’re Doing It Wrong http://www.flickr.com/photos/shadowstorm/3985346700
  • 63. References • http://en.wikipedia.org/wiki/Pair_programming • http://www.slideshare.net/Siddhi/intro-to-pair-programming • http://www.slideshare.net/jlangr/pair-programming-talk-presentation • http://www.slideshare.net/rogercafe/pair-programming-presentation • http://www.slideshare.net/rachellaycock/pair-programming-good-bad-and-ugly • http://www.slideshare.net/dennisdoomen/the-10-habits-of-highly-effective-programmers • http://www.codinghorror.com/blog/2007/11/pair-programming-vs-code-reviews.html • http://en.wikipedia.org/wiki/Pomodoro_Technique • http://collaboration.csc.ncsu.edu/laurie/Papers/XPSardinia.PDF
  • 64. Pair Programming - Summary • Catch more mistakes as they are typed • Improve software design • Solve problems faster • Learn and transfer knowledge better • Create an real team • People enjoy their work more
  • 65. Discuss Find me online: SteveSmithBlog.com Twitter: @ardalis