Pair Programming at a Startup: time sink or saviour?
henrysztul.info
henrysztul.info
I don't need someone looking over my shoulder hunting for bugs while I program. What I need is someone to bounce high-level ideas off of so that I don't get paralyzed by indecision, or overlook an important edge case.
Bad design decisions concern me a lot more than a bug here or there.
In my experience, planning with someone else away from the computer, and then implementing is as fast (and usually faster) than sitting down at the computer and trying to bang something out from scratch.
When you do things this way you don't really need to have another person there because you've already agreed on all the important details.
However, I still think everyone should have their OWN whiteboard, to enable precisely the conversations you mention. Easy enough if you have cube walls, but I've never seen a good whiteboard story in newfangled open-plan startup offices.
Periodic pairing can be a great team building exercise, way to mentor someone, and a great way to be exposed to different programming workflows & tools. This idea doesn't seem very novel to me and hardly deserves it's own terminology, blog post, or article.
Personally I believe "pair all the time" is what is controversial and in my experience excessive. Other then commercial pilots, I don't see other industries where experts always pair.
Also, if 2 people are better then 1 person...why stop there...why not have tri-coding or quad-coding?
- We tried pairing for one day
- Pairing was immensely productive for that session
- Therefore pairing is AWESOME all the time
Pair programming ought to be considered like trimming your nails. Don't do it everyday or it's going to hurt. A lot.
As a math major, I was far more successful when I went to study groups, spent hours trying to prove theorems with other students, or the TA or professor, and so forth. In a way, you could say that's a kind of "pair math", at least the part where you try to work on a proof with another person.
I'd say stay very social and engaged with other people, and don't go dark, but I think tough coding problems require a lot of quiet focus in a place with minimal distractions as well. Like, I'd encourage programmers to find work from a local university library (for some reason, this works better for me even than a private, quiet office).
For example, when I'm debugging, I can easily be several times more productive with someone else trying to guess what is going wrong. On the other hand, for most "glue programming", it feels like a huge waste of time to be looking over someone's shoulder while they try to figure out the best library to play sound or how some website API works.
Regular programming where all of the libraries and general plan are known seems in between those two extremes. Sometimes a second person can help detect problems and/or keep the first person on their game, but sometimes basic conflicts over code style can arise.
I've never been part of a pair programming shop, but I've tried pair programming with similarly inexperienced pairs before. How do people who pair all the time resolve problems like redundancy when looking up or learning information? Relatedly, how do they solve situations where basically one person is the only person who understands how to solve the problem (either because of skills like statistics or because of knowledge like understanding some API), and the second person is just along for the ride?
Also a huge benefit is learning. In that second example there is a lot of valuable skills transfer going on.
It excels in combination with TDD. One person writes a test, and the other person makes it green and writes the next test and so on.
Combining those two practices is very powerful.
Another time I don't like to pair is when debugging or trying to understand some old legacy code or something. If two people have different strategies for doing that it doesn't really make sense to pair. I like to write a lot of stuff down on paper for example, another guy likes to click "step" in the debugger on a lot.
So the answer is, "maybe". Neat.
One time we wrote a quite complicated graph-based algorithm (as in, lots of bug potential, but it turned out bug free) and the other two times we fixed bugs that hounded us for weeks in just one session.
I definitely feel like it works best in those situations when both people can complement each other somehow. If it's just a junior/senior person it will probably not be very useful for the senior person (note I mean a true junior here with little programming experience, not just some non-senior engineers).
I do like these Shelby guys though, so I would love to hear from them in more detail of how it went?
Think of the 2 to 3 hours real work done days? Now it's straight 8 hours of real work. You come out ahead even with two people at one job.
(just kidding)
Correlation does not equal causation...other practices that usually accompany teams that pair include continuous integration and a strong focus on automated testing.