News for hackers. Stuff that matters.
Re:Developers spend most of their time figuring the system out by SomeCallMeTim on Wednesday March 30, 2022 @04:44PM (#30860550)
That just can't be more productive over the long term, though.

Lets say, hypothetically, that you can use it to ramp any programmer up to being an expert on the system. Maybe that takes two months? Or even six months? Once you have a team full of experts, you're now spending two programmer hours to do every bit of work that could have been done in one programmer hour by a single expert.

Unless you have such incredibly high turnover that the period to transform a developer into an expert is close to or less than the average tenure of an employee, in which case your team has other issues that likely need to be addressed, because why are people jumping ship so quickly if it's such a great place to work? (For example: If it takes six months to produce an expert, you'd need to have an average tenure of less than or equal to six months to really benefit from pairing; anything more and the 50% performance penalty has to eat into your overall productivity.)

On top of that, I have never been at a job where it's taken me more than a week to get up to speed on a system, or at least to the point where I can simply ask the occasional question of the experts on a team to get me unstuck. Even if the average developer took a month or two, pairing beyond that point is simply fun and not more productive than two programmers developing independently.

Unless one of the developers is otherwise likely to produce negative productivity on their own, I suppose. I've worked with that kind of developer as well, and the right answer is to eject them from your team, not pay other developers to babysit them.

Re:Developers spend most of their time figuring the system out by WindyCityBrew on Wednesday March 30, 2022 @04:59PM (#30860694)
There are other benefits, pair programming reduces a whole category of simple bugs/typos to basically 0, keeps people on task, offers (literally) immediate feedback.

Unlike most programming "best practices" or paradigms, there's actual empirical evidence that pair programming is "better". Fewer bugs, easier to read code, shorter review cycles.

My guess as to why we don't see more adoption is 1) most developers aren't that fond of it, and 2) most managers do some quick gut check mental math and assume 2 programmers + 1 computer can't be equal to or greater than 2 programmers + 2 computers, that's nonsense, actual evidence be damned.

edit to add: I agree with commenters that pairing is more demanding/draining than solo work. I shudder at the thought of anyone trying to pair for 8hrs straight, or "all day every day 40hrs/wk". Nobody solo programs like that either though.

Re:Developers spend most of their time figuring the system out by darkwater on Wednesday March 30, 2022 @05:33PM (#30861066)
As others pointed out, for many of us pair programming is much more demanding on mental resources. The way I tend to work is by doing micro-breaks, checking out other things I would not be comfortable sharing with someone else; if I don't do that and keep hyperfocused, I get drained quicker. Also you can get a couple of programmers that will go down the wrong rabbit hole for much more time because they reinforce their wrong belief mutually. This obviously happens with individuals as well but if you get the wrong mix it can be much worse.
Re:Developers spend most of their time figuring the system out by darkwater on Thursday March 31, 2022 @04:51AM (#30865150)
Also to expand on this, personally I found pair-programming easier on my mind when done IRL and not remotely. Sitting one next to the other has just more bandwidth available and spreading the communication over it makes it way easier for me. Remotely, I can do it for a 2, maybe 3 hour session and then I'm fried for the rest of the day (but usually those were 2-3 good and productive hours).
Re:Developers spend most of their time figuring the system out by jfk13 on Wednesday March 30, 2022 @05:37PM (#30861107)
I've done "pair programming" a few times, with (I think) great effectiveness, but (a) it's been in a very specific context, where we each brought substantial but not-fully-overlapping expertise to the task (not pairing a newcomer and an experienced developer); (b) it was an entirely voluntary thing that the two of us decided to do, not something imposed on us by management; and (c) it was for short "sprints" of no more than a few days, not for extended periods.

If it became a required part of daily work in my company, I don't think I'd be around for long.

Re:Developers spend most of their time figuring the system out by a9h74j on Wednesday March 30, 2022 @06:55PM (#30861870)
Interesting question then:

For what characteristics of problem is pair programming more useful, when such problems arise? Is there a pattern to plan for?

Re:Developers spend most of their time figuring the system out by weq on Thursday March 31, 2022 @02:28AM (#30864401)
Pair programming for me works best on complex issues I, or others, have already failed at. Usually its a short term endevour (minutes), ive only done (hours) of pairing in extreme circumstances either during PoCs or prod issues.

My opnion is that people need time and practice to aborb. Everyone has there own way. If you are pairing everyday for no other reason then company policy, it sounds like the worse place in the world to work.

Re:Developers spend most of their time figuring the system out by mattmanser on Thursday March 31, 2022 @06:41AM (#30865712)
None of what you're describing is pair programming, that's just giving someone a hand and/or mentoring.
Re:Developers spend most of their time figuring the system out by azemetre on Wednesday March 30, 2022 @05:22PM (#30860931)
I don't mind pair programming but I don't have the physical/mental capacity to do it for a full work day. I can only imagine how exhausted I'd get after several weeks of it.

When I do pair, I only work for 3 or 4 hours that day total.

Re:Developers spend most of their time figuring the system out by Tabular-Iceberg on Wednesday March 30, 2022 @05:38PM (#30861111)
Pair programming is one of the smartest inventions in this field, but I wouldn't dream of advocating it for this reason.

The best model would be four hours of pair programming and another four of paying those programmers to take a long lunch, a nap and a walk. Those 4 keyboard-hours would probably be as productive as 16 keyboard-hours of the same programmers working independently for a full day, if not more. And unlike full time pair programming it would be sustainable.

Re:Developers spend most of their time figuring the system out by azemetre on Wednesday March 30, 2022 @11:21PM (#30863508)
I don't disagree, but like all business initiatives it's really hard to convince my boss's boss, that I should be able to sign off and work half the amount of hours for the same paycheck.

So we have to "play" the game of looking busy and appearing productive for appearances.

Re:Developers spend most of their time figuring the system out by artificialLimbs on Thursday March 31, 2022 @01:08AM (#30863997)
Maybe the best for you. I enjoy a couple/few hours of teaming up or conversation, and then a heavy rest of the day solid coding/planning/research with a lunch break and a few short water cooler meetings.
Re:Developers spend most of their time figuring the system out by teknopaul on Wednesday March 30, 2022 @05:31PM (#30861039)
3 or 4 is just fine. I worked at a place that only did pair programing, but quite often we would break up to write docs fill out jira issues and do all the other stuff that's needed. Recently we did 3 way programming once a week for 1 to 3 hours and it still had a lot of the benefits. Not sure being absolutist is a good approach to anything in our field.
Re:Developers spend most of their time figuring the system out by fragmede on Wednesday March 30, 2022 @05:06PM (#30860771)
Therein lies the problem. How much is an avoided bug really worth? A > where really a >= is needed is theoretically going to get caught with pair programming, but how do you make that a metric you can track when we still don't have any way of measuring developer productivity. We never got past the fact that measuring lines of code output is dumb, to any other sort of metric. Even if we had such a metric (using magic, perhaps), would programmers actually welcome it?
Re:Developers spend most of their time figuring the system out by Clubber on Wednesday March 30, 2022 @11:37PM (#30863588)
Not only that, but that same bug can probably be caught cheaper with a good human QA department.
Re:Developers spend most of their time figuring the system out by SomeCallMeTim on Wednesday April 06, 2022 @02:28PM (#30935725)
"Fewer bugs" needs to produce 2x productivity over the productivity of the two developers independently in order to actually be a benefit. Code review and using typesafe languages can also catch nearly 100% of those bugs as well, without the 50% performance penalty.

"Keeps people on task" seems like management-think adjacent to "butts in chairs in an office" requirements: There's a fear that someone might be "wasting" time by being distracted, when you seriously need to contemplate problems sometimes.

I'd need to see that "actual evidence" that we're allegedly discarding. Two programmers with two computers clearly could produce twice the productivity if they're both strong programmers. When I've been pairing with people I simply do all the work. I might get 1-2 comments per hour about a missing semicolon that I would have discovered the moment I tried to build. The claims of the pairing advocates are pretty hard to believe, and I don't see extraordinary evidence to back their extraordinary claims.

As I intimated above, the only way it would work is if the developers are junior (or mediocre) enough to be prone to contributing 0.5x or less productivity left to their own devices, so that the two developers' inadequacies at programming complement each others' and you get a 1.5x productivity out of them combined or something. And I do suspect that companies use that fact to hire less competent developers and make them at least reasonably productive; Pivotal does 100% pairing, and sells it hard, but note that they're paid per developer hour and so actual productivity per-developer isn't what they're necessarily what they wanted to optimize.

As to your Edit: The exact thing I'm objecting to is 100% pairing, which is practiced at some companies like Pivotal. Or worse, 100% mobbing, which is more than two people at one screen.

Re:Developers spend most of their time figuring the system out by moonchrome on Thursday March 31, 2022 @06:15AM (#30865567)
This may work for simple tasks and mid level work. For complex and exploratory work I hate it.

I've been programming at various levels of abstractions and different stacks for 20 years. I often have very good intuition on diagnosing and solving technical problems. It's very hard to verbalize this, especially to people without the same background, it's intuition built on hours and nights of pain and debugging/googling/prototyping and I often need to search and REPL/prototype things to know I'm going in the right direction.

So I waste time dragging the other person along my mental path, and when I go into a wrong direction the cost is also increased by having to explain what I'm doing + the other person usually being annoyed at being dragged along for something they barely understood and it ends up being for nothing.

Re:Developers spend most of their time figuring the system out by raverbashing on Wednesday March 30, 2022 @05:10PM (#30860816)
I agree with the benefits

But you also have 2 developers using 100% "of their cpu" during that time, which is really unsustainable for longer periods.

Re:Developers spend most of their time figuring the system out by Keyframe on Wednesday March 30, 2022 @06:29PM (#30861617)
One of threads is reviewing code as well, which would be done later on anyways.. among other benefits. I'm invoking commodore64 days for the second time in a row now - back then, during the war, as kids we didn't have much comouter lying around so few of us gathered around a single one and learned and tinkered with it. It was awesome since everything bounced out loud from multiple brains. XP in general is alright but maybe not all of the time, as with anything.
Re:Developers spend most of their time figuring the system out by Supermancho on Wednesday March 30, 2022 @09:04PM (#30862709)
> Unlike most programming "best practices" or paradigms, there's actual empirical evidence that pair programming is "better". Fewer bugs, easier to read code, shorter review cycles.

While I agree with that, the cost-tradeoff is not worth those improvements (which are slight). Feel free to post to the studies that you find compelling.

Re:Developers spend most of their time figuring the system out by Jensson on Wednesday March 30, 2022 @07:07PM (#30861970)
> There are other benefits, pair programming reduces a whole category of simple bugs/typos to basically 0

No it doesn't, bugs happens since there is much acceptance for bugs, programmers develops just enough awareness of them to get the bug count to maximum acceptable levels. If you take two programmers who both learned to get there on their own and have them oversee each others work, you reduce the bugs temporarily, until they adjust their attentiveness and conscientiousness downwards to account for it and the bugs rise again until they are at barely acceptable levels.

You see temporary improvements like this happen everywhere. Researchers love it because it makes it trivial to publish papers, but these results usually doesn't scale, and even when they do scale the effect is significantly smaller than originally advertised.

Re:Developers spend most of their time figuring the system out by WindyCityBrew on Wednesday March 30, 2022 @07:23PM (#30862074)
(I know you run out of people in real world teams pretty quickly but) rotating pairs regularly helps with this, with a maximum of two-week pairings to avoid this and other issues.
Re:Developers spend most of their time figuring the system out by depr on Wednesday March 30, 2022 @05:21PM (#30860917)
Can you provide this evidence?
Re:Developers spend most of their time figuring the system out by caseyohara on Wednesday March 30, 2022 @05:24PM (#30860960)
Re:Developers spend most of their time figuring the system out by akhmatova on Wednesday March 30, 2022 @07:02PM (#30861931)
Yeah, we can't expect that company to also post articles that show either less splendid (or negative) tradoffs of PP, now can we?

Meanwhile, some of that research is pretty easy to deflate. From the first article, for example:

Students prefer the 15% overhead

That's right -- they used a survey of student experiences to draw conclusions about what works best for senior developers well into their careers. As the authors themselves put it: "We feel that this is a strong indicator of the satisfaction of pair programming."

I don't see how they can call this "strong" evidence of anything.

Re:Developers spend most of their time figuring the system out by NaturalPhallacy on Wednesday March 30, 2022 @06:03PM (#30861381)
There's no way that isn't biased as that company's product is pair programming software.
Re:Developers spend most of their time figuring the system out by zozbot234 on Wednesday March 30, 2022 @04:55PM (#30860658)
True expertise on a large, complex code base does not just take a few months; competence is best modeled as growing over long timespans, not as something that quickly reaches an "expert"-level ceiling. This is all the more true when-- as is often the case-- the codebase is a complicated legacy thing, full of accumulated "technical debt" and unneeded complexity of all sorts. This is not to say that 100% pair programming is always the answer, but doing it to some extent is likely warranted.
Re:Developers spend most of their time figuring the system out by dboreham on Wednesday March 30, 2022 @11:27PM (#30863536)
Someone with much more experience than me once told me it always takes a year. He turned out to be right, at least over the past 25 years.
Re:Developers spend most of their time figuring the system out by artificialLimbs on Thursday March 31, 2022 @01:17AM (#30864041)
This is exactly what I'm currently jumping into as a 'new' dev. I've been coding for about 3-4 years, am working on an ANCIENT php in-house ERP (we're still running v5!), and find the technical debt/unneeded complexity more shocking by the day. I've been in this position 3 months and feel like I've barely even scratched the surface of what is going on under the hood.

Teaming up for training is absolutely crucial at this time.

Re:Developers spend most of their time figuring the system out by joshuacc on Wednesday March 30, 2022 @05:06PM (#30860779)
Having worked at both a mid-size EdTech company and now in a smallish part of Microsoft, every codebase for public-facing software that I've seen would take at least 1 year to achieve actual expertise in (while guided by an expert!) and would probably take much longer.
Re:Developers spend most of their time figuring the system out by quickthrower2 on Wednesday March 30, 2022 @08:27PM (#30862477)
People forget what a creative profession coding is. The assumption that programming is a factory is what is being challenged. Most companies seem to have a factory approach and so you end up with technical debt weighing everything down to the point people just can’t get stuff done and the job becomes more about explaining why you can't do stuff.

To give a more concrete example a pair programming session might avoid putting in foundational code that ends up being a bad design choice and slowing down the team by 1% forever. Maybe at a cost of millions. That 1% will never show up in any OKR or KPI that just basically measures superficial stuff about the status quo (bugs raised per quarter, features delivered on time etc.)

I mean it is like we forget we live in an age where still someone smart coding at their laptop can launch a million dollar business.

If you can figure out a smart “hot take” way of working, like maybe pair programming it is a big competitive advantage.

To the point you probably wont find a job for a company that works that way because they can more than make do with a small team.

Re:Developers spend most of their time figuring the system out by hallway_monitor on Wednesday March 30, 2022 @04:59PM (#30860697)
You are correct in that having two people both well-versed in both the system and the change they are making is a waste. However, that tends to be rare - the more common situation on a team with no newbies is that you will need to solve new problems with new methods, possible integrating with new systems.

If you have a team of experts, and you want to keep them all experts, it's much more economical to have two people learning the new code as it's being written. Theories about what might or might not be helpful have very little value until tried in the field.

Re:Developers spend most of their time figuring the system out by pixl97 on Wednesday March 30, 2022 @06:18PM (#30861516)
I'm not seeing anyone mentioning what you should do in the case where the one person that knows the code gets hit by a bus.

Would anyone ever say you only need one copy of the code, because backups are inefficient?

Re:Developers spend most of their time figuring the system out by toomanydoubts on Wednesday March 30, 2022 @08:33PM (#30862525)
Hire a professional to pick up where he left off?
Re:Developers spend most of their time figuring the system out by pixl97 on Thursday March 31, 2022 @06:47PM (#30873089)
Right, I'm sure they'll be up to speed within minutes and your business will suffer no delays or impacts!
Re:Developers spend most of their time figuring the system out by runeks on Thursday March 31, 2022 @02:51AM (#30864524)
> Once you have a team full of experts, you're now spending two programmer hours to do every bit of work that could have been done in one programmer hour by a single expert.

You’re forgetting that it’s impossible for any one person to keep all the details of even a medium sized code base in their head.

I imagine the initial “planning” phase of implementing a change would benefit heavily from pair programming because it avoids the issue where you write a bunch of code to find out that it doesn’t work because of this one detail that you forgot.

For the learning (“knowledge transfer”) aspect, though, I think you’re right that it’s possible to reach a point where writing the actual code (not the design) as a pair is not worth it.

Re:Developers spend most of their time figuring the system out by truculent on Thursday March 31, 2022 @08:10AM (#30866277)
There's a trade-off between efficiency and robustness.

It may not be as efficient, but it can be more productive in the long-term if you're better insulated from staff turnover, for example. Making engineers more replacable could also contribute towards lower wages (more able to hire beginners and make them competent, reduce leverage of existing staff).

Re:Developers spend most of their time figuring the system out by troupe on Thursday March 31, 2022 @10:17AM (#30867467)
> That just can't be more productive over the long term, though.

While you can type a lot more by having two people type in parallel, some programming is much heavier on the problem solving aspect of things and those types of problems are sometimes completed more rapidly with two people working together than with two people working separately.