DEV Community

Cover image for How pair programming can change your coding experience

How pair programming can change your coding experience

As a self-taught developer, I have mostly spent my time doing online courses, following tutorials, coding and building projects alone. I hardly got any feedback to know if I was learning the right technologies or writing clean code.

This situation changed when I joined The Collab Lab. It was my closest experience to a β€œreal developer job”, as I had the chance to work in a team building an app.

During that time I had several pair programming sessions with 3 different colleagues. So every week two of us would sync remotely (as each of us was located in a different country) to have a discussion about the issue we had to solve.

Remote call gif

I like preparing pair programming sessions in advance so the way I proceed was reading the issue in detail, doing some research and noting down some potential solutions to be discussed with my colleague.

How did we do pair programming remotely? We hopped on a video screen share call, where one of us was acting as the driver and the other one as the navigator. What does this exactly mean and what does each of them do?

Driver & navigator image

The driver takes full control of the keyboard and is responsible for writing the necessary code to complete the task. This person will also speak out loud the thinking process behind the code.

The navigator pays attention to the driver's code and offers guidance, suggests new ideas and finds answers to the questions that might be raised during the process.

The driver has a low-level code thinking approach, while the navigator has a bird-eye view on the code.

During pair programming sessions, developers can swap roles so that each of them has the chance to experience both perspectives (two modes of thinking) and learn.

What did I learn from the whole experience?

  • Be open and eager to learn.
  • Embrace doubt and possibility.
  • See another person's problem solving approach opens up your mind/ideas.
  • Don't be afraid of sharing your ideas or asking questions.
  • Communication is key to make your code or ideas understandable.
  • Take breaks when both get stuck.
  • It is not about teaching nor mentoring, but looking for a solution and growing together.
  • The driver (seek agreement before proceeding) and navigator (asking, not telling) approach.
  • Collaboration, team work.

Pair programming has definitely been a much more efficient, enriching and fun experience than all hours I spent coding by myself. If you are a codenewbie, I can only recommend you start with pair programming sessions as soon as possible to learn faster.

Oldest comments (11)

Collapse
 
marcinwosinek profile image
Marcin Wosinek

You have a good point, pair programming can be a very effective way for a fast knowledge transfer or to let people figure out stuff together. I didn't have many opportunities to practice it, but every time I did, I was surprised:

  • how efficient it goes,
  • how tired I'm afterwards:)

As senior dev how onboard people, for people I onboard on a project, I usually:

  1. give small, well-defined tickets;
  2. ask them to ask questions when they get stuck,
  3. review closely their code.

When all points work as expected, I find this asynchronous approach almost as efficient as pair-programming.

Collapse
 
crispitipina profile image
πŸ§©γ€β„‚π•£π•šπ•€π•₯π•šπ•Ÿπ•’γ€‘πŸ’‘

Thanks for sharing! I am also surprised about seniors also getting tired ;)
I guess asynchronous also works but when getting hands into code, I find pair synchronous simply faster.

Collapse
 
marcinwosinek profile image
Marcin Wosinek • Edited

Yes, we doβ€”we are humans too:)

Yeah, pair programming is definitively faster, especially from the perspective of the learner. In case of async approach, you drop juniors at problems they will struggle with, and after they despair a bit you help them out. It's a trade-off between using senior time to save junior time (and a bit of their self-esteem too).

Collapse
 
chrisgreening profile image
Chris Greening

Really great reflection Cristina!

I'm in a similar situation being self-taught and working remotely with folks from all over the world and pair programming is hands down one of my favorite learning experiences/exercises

I was solo-developing relatively large codebases and projects before breaking into my first true tech job and it was Earth shattering realizing how much of an echo chamber I'd been learning in - I had to unlearn a couple of nasty habits that are fine when you're working by yourself but not so fine when collaborating and I'm significantly better off now having gone through that initial shock πŸ˜…

As clean and readable as I thought my code was didn't mean everyone else would understand what I was doing. Receiving critiques and feedback in realtime has dramatically improved my code's quality and maintainability in ways I wouldn't have thought of prior

Collapse
 
crispitipina profile image
πŸ§©γ€β„‚π•£π•šπ•€π•₯π•šπ•Ÿπ•’γ€‘πŸ’‘

That sounds great! Happy to hear that pair programming has also helped you improve a lot. Congrats!

Collapse
 
juzarantri profile image
Juzar Antri

Is there any platform for pair programming?

Collapse
 
__masashi__ profile image
Masashi

Well, the feature exists on replit.com

Collapse
 
vulcanwm profile image
Medea

yea replit is really good for multiplayer programming

Collapse
 
crispitipina profile image
πŸ§©γ€β„‚π•£π•šπ•€π•₯π•šπ•Ÿπ•’γ€‘πŸ’‘

I would suggest you getting a mentor or joining any coding community like Freecodecamp or Codebar :)

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
alvarolorentedev profile image
Alvaro

Pair programming should be the go to practice in any team.
I need to clarify is not only a tool for newbies to be onboarded or learn is a way to generate better code and actually achieve CD.
Its a peer review methodology that allows removing the overhead of async comunication that causes rework, and provides multiple points of view on the fly, specially if you apply pair rotations.
Actually, there are quite a few ways of doing pair programming, the one i enjoy and recommend the most is ping-pong, doing TDD and pair programming at the same time, is the best way of doing robust and minimal code that is not overengineered (very common among senior engineers).