Today I spent the whole day debugging an elusive concurrency problem in ruby on rails running on JRuby. We start some threads during the web request and, usually sooner than later, all our database connections are blocked.
Getting deep into the details of multithreading, connection pooling and the like is nothing I enjoy doing. Especially not alone. I was really glad to have a buddy for the job.
Talking about a Problem helps sort your thoughts
Even thinking about all the twists and turns of our business logic made my head hurt. Having someone to actually talk about them made things better. If you force yourself to articulate the mess in your brain, it usually starts sorting out much easier than if you would try to only think it through. I know that this is not everyone’s thing to do, but for me it is very helpful.
When you run out of ideas, your pair might come up with a new one
Especially in chasing bugs, I usually start with a host of ideas where I could look for the issue. But, after hitting some dead ends, it becomes harder and harder to think of new approaches to address the issue at hand. Working together in such a bug hunt helps because as soon as the one runs out of ideas, the other one might come up with the guess, where to find the solution. Together, you’re able to avoid unproductive gaps throughout your workday.
Staying in “the zone” through laser sharp focus
Sitting together at one desk helps to completely ignore all those permanent distractions like incoming e-mail, twitter or IRC. Talking to each other and working on a problem together enabled us to keep focused on the issue at hand for over 8 hours today (short breaks included). After so many productive hours I feel completely drained, but it was worth it. Even though we didn’t fix the issue today, we sure learned a lot… Hope to squash it tomorrow.