---
tags: ironhack, lecture,
---
<style>
.markdown-body img[src$=".png"] {background-color:transparent;}
.alert-info.lecture,
.alert-success.lecture,
.alert-warning.lecture,
.alert-danger.lecture {
box-shadow:0 0 0 .5em rgba(64, 96, 85, 0.4); margin-top:20px;margin-bottom:20px;
position:relative;
ddisplay:none;
}
.alert-info.lecture:before,
.alert-success.lecture:before,
.alert-warning.lecture:before,
.alert-danger.lecture:before {
content:"👨🏫\A"; white-space:pre-line;
display:block;margin-bottom:.5em;
/*position:absolute; right:0; top:0;
margin:3px;margin-right:7px;*/
}
</style>

# SG | Pair Programming Introduction
## Learning Goals
After this lesson, you will be able to:
- Understand what Pair Programming is
- Understand why it is important to practice it
- Pair Program with your partners efficiently
## What is Pair Programming?
Pair Programming is a practice that comes from [Extreme Programming](https://en.wikipedia.org/wiki/Extreme_programming), predecessor to [Agile](https://en.wikipedia.org/wiki/Agile_software_development), where two developers work simultaneously on the same code together.
:::info lecture
<span style="font-size:800%">👯♂️</span>
:::
Both developers are carrying a different role while coding, meaning they are not simply coding at the same time, but writing and reviewing the code as it is developed. The roles are separated as follow:
- <span style="font-size:300%;">👨🏼💻</span>**Driver:** The one who's writing the code. The driver will determine the way the code is written following the orders of the navigator. So if the navigator says to go through all the letters in a string, the driver is going to decide how to do it.
- <span style="font-size:300%;">👩🏾✈️</span>**Navigator:** Is going to think ahead of the situation, deciding the next steps, and how best to approach the problem, leaving the details to the Driver.
## Why is it so important?
Pair Programming allow us to learn together, no matter if we are at the same level. When doing Pair Programming, both people can learn to write understandable code for other people, to discuss other ways to solve the same problem and, separating roles, we can focus on improving either our technical skills or our ability to split functionality in many little parts.
## Ways to do Pair Programming
There are 3 main ways to do it:
- 1 Keyboard | 1 Screen
:::info lecture
<span style="font-size:300%">👩🏾✈️ + 👨🏼💻</span>
:::
- 2 Keyboards | 1 Screen
:::info lecture
<span style="font-size:300%">👩🏾💻👨🏼💻 + 🖥</span>
:::
- 2 Keyboards | 2 Screens
:::info lecture
<span style="font-size:300%">👩🏾💻 + 👨🏼💻</span>
:::
## Ironhack Pair Programming
Ironhack focuses in **1 Keyboard | 1 Screen** , so we take [turns of 25 minutes](https://en.wikipedia.org/wiki/Pomodoro_Technique) to hold the Keyboard and be the ***Driver***, or think about the problem as the ***Navigator***
:::info lecture
<span style="font-size:300%">👩🏾✈️👨🏼💻 ↔ 👨🏼✈️👩🏾💻</span><br>
☝️ Rotation toutes les ⏲ 25 minutes !
:::
## Tips for aspiring pair programmers
- Keep distractions away
- Set the goal clearly, so both of you know where the path ends
- Always be nice! Use constructive feedback and etiquette
- Share everything. Don't be afraid, there are no bad ideas, just other points of view
- Don't hog the keyboard
- **DON'T HOG THE KEYBOARD**
- Take breaks when needed (change roles)
### Respect your partner

### Don't Intimidate your partner

## Extra Resources
### Spooning - Bitbucket
{%youtube dYBjVTMUQY0 %}
### 7 Habits of good Pair Programming
{%youtube 5ySLQ5_cQ34 %}
### Does Pair Programming have to suck? - Angela Harms
{%youtube OQXEzwXtzJ8 %}