Tag Archives: pair

Remote Pair Programming with GNU Screen

Pair programing from a distance can be hard, and up until today my best answer for that was a high-bandwidth, laggy VNC connection.

Today we tried something a bit different.  My programming partner logged into my computer over SSH and then shared a GNU screen session I was using.  It was instantaneous on both ends, even with Skype running alongside it.  More-so, we could each switch between `screen` windows independently so we could look at the things we wanted to, when we wanted to.

To get this set up, open a screen session locally and then type ^a, followed by “:multiuser on”.

The other person can log in as the same user over SSH and just run `screen -x` to attach to your session.

Amazingly simple and insanely fast.

UPDATE: The link above has been removed – you can find it on the internet archive at http://web.archive.org/web/20110722182545/http://ryanwilliams.org/2010/Oct/09/gnu-screen-256-colours-mac-os-x

Pair Programming

In the past I’ve tried to ignore all of the really smart people that think pair programming is a useful (if not vital) strategy. I’ve watched talks on it, I’ve seen all types of pairing stations, I’ve listened to numerous people iterate the benefits — but never until this week did I actually give it a real try. I guess I dismissed it as a fad, and didn’t think it was for me.

I’ve spent the past four days paired, and am hooked — I figured it’d be useful to write my own list of why pairing is amazing.

Why?

  • Saying things out loud (to yourself or to someone else) is valuable, because forcing yourself to describe the problem/solution ensures that you actually understand it
  • When one person hits a lull, or has a tasty sandwich, the other person can take over
  • The exposure of shitty, lazily-written code is higher, so neither or you will write it to avoid embarrassment
  • A lot of times when working alone, you’ll force your solution to work – when paired, the mental cost of a change in strategy is much lower
  • Pointing out to each other new patterns and tips increases everyone’s productivity and knowledge
How?

I don’t subscribe to the one-keyboard idea, but rather two monitors (mirrored) and two keyboards, hooked into the same computer – sitting next to each other. The setup worked really well, and I found that it was easy to settle into a rhythm where each of us would type and throw ideas back and forth. We all use vim as an editor, so switching back and forth is painless.

You should definitely give it a shot if you haven’t already. My days have gone by faster, been more productive, enjoyable, and full of new things.