News for hackers. Stuff that matters.
Re:On Trust in Software Development by twawaaay on Thursday March 23, 2023 @07:20PM (#35282902)
My observation is that code reviews are one of the worse solutions to the problem. They are almost never done right. People tend to treat them as nuisance and not focus or focus on the wrong things. Or people try to be nice to other people and "not make problems". They are constant source of problems because they tend to crash into deadlines and usually lose. It is also frequently the first time somebody finds out somebody else spend a week writing a feature producing completely unusable mess which could have been avoided if there was human contact during development. Also reviewing large body of work after it has been "completed" is simply the worst time to have open and critical discussion about quality.

My tested and recommended process is working in pairs, rotating pairs regularly and sharing/rotating all tasks within pairs, equally. You have two people actively working together on each piece of code. They are supposed to both understand what is happening, care for quality and be vigilant to catch defects. This is also the right time to have actual input regarding quality or design improvements. And the code once it is done can immediately be committed and shipped so there is no awkward delay between code finished and deployment.

I also learned over the years pair programming is also a fantastic way to achieve some other goals like people socialising, getting to know each other professionally, learning from each other, newcomers getting bootstrapped, etc.

Re:On Trust in Software Development by jvans on Thursday March 23, 2023 @07:41PM (#35283102)
Pair programming appears to management as a huge waste — two people doing 1 job!! — but having done both I believe the exact opposite. It increases bus counts, speeds up shipping code(no waiting for review), and improves quality. It is very difficult to ramp someone up on your hard problem you've been working on for days in a short time. If someone is there in the weeds with you, it's so much easier to talk it through.

Pull requests degrade to nit picks that are irrelevant to code quality and code function to make the reviewer feel like they are contributing

Re:On Trust in Software Development by folkhack on Thursday March 23, 2023 @07:54PM (#35283208)
> Pair programming appears to management as a huge waste — two people doing 1 job!

Sorry to play devil's advocate, but pair programming is literally two people doing a job that has traditionally/historically been done by one person. There is no surprise this is going to cause raised eyebrows with management. Two devs sharing a keyboard is 100% going to be seen as two people fulfilling a single person's job to nearly anyone external to the role for obvious reasons.

Re:On Trust in Software Development by l0b0 on Thursday March 23, 2023 @09:11PM (#35283794)
Another way to look at is is two people doing two jobs at the same time - programming and code review. Or even three jobs, if you include the (IME incredibly useful) design review which seems to happen almost inevitably as part of the implementation.
Re:On Trust in Software Development by tharkun__ on Friday March 24, 2023 @08:51AM (#35288358)
And it's incredibly one sided. If you and your peers like it, use it.

I happen to hate it. Tried it at multiple companies and it still makes no sense to me. You are forcing two people to do a specific thing at the same time and pace. One of them has a meeting? Sorry can't do any work. Oh the other guy has a meeting after yours is done? Can't do any work. Oh one of them has a doctor's appointment? No coding.

I prefer "the best of both worlds". Workshop/whiteboard the solution. Go separate ways if possible working on different parts of the problem. A great split is someone doing the frontend and the other doing the backend if that's the kind of thing you are working on. Or find some other way to parallelize. Reconvene after some hours/when you are done with something agreed upon or if "stuck".

Not everyone likes 100% of the time social contact. Sometimes I just really need to be left alone in a corner, head down, no distractions.

Re:On Trust in Software Development by twawaaay on Friday March 24, 2023 @10:35AM (#35289585)
Pair programming is definitely not for everybody. Some people hate it for multiple possible reasons -- because they can't focus with other person talking, because even if they stop talking the awkward silence is distracting, because they are distracted by their feelings about putting up half baked code and opening their development process to another person, etc.

What I do is that I include pair programming as part of interview process to let people experience the process a bit before they decide to join the team. Can't do much about people who are already in the team -- I try to be flexible about it but only to some extent.

In the end, being part of large software development project is a social endeavour, whether you like it or not. I get that some people prefer to work alone but I have to insist that social part cannot be somehow ignored.

Re:On Trust in Software Development by JohnFen on Friday March 24, 2023 @11:10AM (#35290064)
> I have to insist that social part cannot be somehow ignored.

Not doing pair programming doesn't mean the social part is ignored. It only means that the social part is done separately from the keyboard work.

Re:On Trust in Software Development by twawaaay on Friday March 24, 2023 @12:04PM (#35291031)
By social part I don't mean socialising. I mean multiple people working together to achieve a business result being unable to work as mere robots following a procedure but rather working together as human beings with all consequences of it.
Re:On Trust in Software Development by JohnFen on Friday March 24, 2023 @12:06PM (#35291062)
Yes, I understood what you meant and was replying with that understanding.
Re:On Trust in Software Development by tharkun__ on Saturday March 25, 2023 @10:38AM (#35303060)
I agree that the working together in a team can not be ignored. You call it the social part, fair enough description, though easily confused with the socializing part.

What 100% pair programming does however is to dictate exactly one way of achieving that goal. Like with any form of dictatorship, I think there is more harm than good in it.

Pair programming in an interview would not be an issue for me for example. It is something that I do in some situations. Just two days ago, I had a PR comment from someone on how to do a part of what I was doing differently - and better. That was great but I wasn't sure how exactly it would play out and hadn't used that particular way of using the framework we're using. So I pinged him and we hammered it out together in 15 minutes of pair programming. Then he dropped off the call and kept working on his task while I cleaned up the mess of copy and pasted, commented out and `blah = newFunction()` type code we created in order to quickly figure out if "the other way" of doing things would work and if it actually was better.

Coming back to the interview situation, we'd probably get along fine in pair programming that together and you'd want to hire me. And then you tell me that this is how I will be required to work 100% of the time and I'll end the interview right there.

Re:On Trust in Software Development by twawaaay on Saturday March 25, 2023 @11:50AM (#35303859)
As a tech lead I am tasked with finding ways of organising development process to achieve the result the best way we can.

At some point this has to result with dictating how people need to behave, what is expected of them. Unfortunately, giving people just the goal and no process to get there does not work. What does work is giving people progressively more freedom after they have shown this can at least potentially lead to better results. Taking away freedoms does not work -- people become resentful, demotivated and stop working. That's why demoting people very rarely leads to good results.

Giving entire team complete freedom can work with highly selected individuals who are very committed and motivated to achieve the goal. But then the reason this can work at all is because they organise themselves and they honour their internally established constraints. But those circumstances are rare in large companies and building those teams is extremely difficult. I am not naive to think I can do it and even then I usually am given a team rather than given free hand to choose whatever people I want at whatever price I find necessary.

I empathize with people who don't like being constrained in how they do work, I don't like it myself. But this to some extent is required to get a large organisation working. The best solution is to do your job well and show it is in everybody's interest to give you more freedom.

> And then you tell me that this is how I will be required to work 100% of the time and I'll end the interview right there.

And I think it is perfectly fine. This is the point of interviewing process -- for me to find if I can work with you and for you to find if you want to work with me. For my end I try to explain and demonstrate how it would look in reality. It costs me much more to hire somebody that will then be unhappy with the process. On a more personal level I am trying as much as I can to not hire people that I would have to soon fire. I hate firing people. And more than that I feel responsible for causing problem to a person that I could have prevented by not hiring them in the first place.

So in a sense you breaking the interview is win win for both of us.

Hopefully there would have been screening before the interview where you would learn a bit about how we work and you would leave the process with less disruption to both of us.

Re:On Trust in Software Development by tharkun__ on Saturday March 25, 2023 @01:17PM (#35304800)
Nice to be talking to a fellow tech lead then.

I think dictating exactly how people need to work is counter productive if you work with highly skilled people. I like working with people that I can give a goal and we can talk about how to achieve it best together, try some things and see if it makes it better or not. E.g. we've tried pair programming in the team and most people didn't like it at all, just like myself. I am not going to force it on them. To your point, which is very valid, if someone did that to me after the fact, I'd quit.

Personally I don't think the solution is to force every new hire to 100% pair program, while I myself would then not pair program when I do code. That sends the wrong signal. Do as I say not as I do. And yes that does mean I'm constrained in who I can hire or work with. Not everyone will "make it" on my team. E.g. as people progress I will progressively expect them to communicate about being stuck by themselves instead of me asking if any help is needed. They either learn how to do that and work in a team or they are not made for mine. A Senior Developer I need to nanny every 2 hours is not a Senior Developer.

It doesn't mean we have zero process of course. I just don't believe in a process that enforces 100% pair programming ;)

Re:On Trust in Software Development by JohnFen on Friday March 24, 2023 @11:08AM (#35290039)
Yes, I'm highly allergic to pair programming as well for a bunch of reasons. Fortunately, I've only rarely encountered it on the job.

I can't seem to code and engage in an ongoing human interaction at the same time. It has to be one or the other. I also really hate having someone looking over my shoulder while I'm typing.

Re:On Trust in Software Development by lcall on Friday March 24, 2023 @12:50PM (#35291878)
As am I. I guess it is related to having "Sensory Processing Sensitivity", a newer name for "Highly Sensitive Person", which basically means that one thinks deeply about everything all the time, whether they want to or not, and quick context changes (like having that train of thought interrupted frequently in pair programming) is highly disruptive. One TED talk about on youtube said it affects 1/5 people, even among animals, and it can't be changed, and has pros and cons.
Re:On Trust in Software Development by JohnFen on Friday March 24, 2023 @01:26PM (#35292471)
> which basically means that one thinks deeply about everything all the time, whether they want to or not, and quick context changes (like having that train of thought interrupted frequently in pair programming) is highly disruptive.

Wow, this is me. A friend once analogized it to being like a light source. I am a laser, deeply penetrating a narrow spot, but leaving the larger field in the dark while I do so. Other people are like a floodlight, illuminating a large area, but not deeply penetrating any particular portion of it.

I always though of being like a laser as a kind of superpower, though, not a pathology.

There are, naturally, advantages and disadvantages to each way of thinking. A good team needs both lasers and floodlights.

Re:On Trust in Software Development by jvans on Thursday March 23, 2023 @10:00PM (#35284119)
my point is the literal interpretation doesn't come close to capturing the business value
Re:On Trust in Software Development by twawaaay on Friday March 24, 2023 @08:38AM (#35288215)
I have this conversation literally every single time I join a team. (I am tech lead and/or manager and it is usually my responsibility to shape the development process).

People are definitely NOT taking twice as much time per-person to write a piece of code.

First of all, code review is already a cost tacked onto development to ensure quality. So one could say code reviews are a waste of time. Well... not necessarily. It is always cheaper to catch and fix an error closer to the source of the error. When the error happens in prod it may be costing your company millions, but the same error caught in review may mean a cost of somebody's 1h review and half a day to fix it and then re-review it.

So we are saying: it is better to spend a bit of extra effort upfront than let those quality problems spew uncontrolled into codebase and production environment.

Naively, pair programming means one person writes the code and another "watches" and catches errors. But that's not what is happening. People discuss the course of action so you usually already get better result with two people doing it. Then there is the fact that if one person would get stuck it is usually much faster to get unstuck with another person involved.

And you get other effects, too. For example, I find it impossible to procrastinate when working in pair with another person. It would be just disrespectful to the other person to be wasting time while we are both assigned and expected to produce results.

All this means that not only the quality is better than if one person worked on it, but also the work progresses much faster.

I would also suggest that in many businesses the most important factor is not development efficiency per se, but how fast can you deliver a given result. Meaning, if business figures out they want capability X, how fast you can provide it.

To get to X you create a project with tasks. Any project will have critical path and adding more resources to the project will not speed up the project at all. The only way to speed up the project is to either change the critical path to a shorter one or speed up the tasks on critical path.

There is normally very few ways to speed up development tasks. You can reassign them to your best/fastest devs. You can produce more technical debt. That's about it.

So working in pairs offers an invaluable ability to speed up the development process without creating more technical debt and without using your critical resources.

And yet another effect is scaling your development operations. Normally, adding more developers to the project creates more efficiency. Twice larger development team will not be twice more efficient. Working in pairs counteracts this problem a bit, ie. it lets the team be twice as large at the same level of efficiency/complexity. Any techniques that let you stave off the effects of growing organisation are very valuable.

Re:On Trust in Software Development by JohnFen on Friday March 24, 2023 @11:13AM (#35290099)
> I find it impossible to procrastinate when working in pair with another person.

True. But on the flip side, I've found that it also makes it impossible to sit and think deeply about an issue at hand. The tendency is to rush, so it doesn't look like you're not participating.

Re:On Trust in Software Development by rgblambda on Thursday March 23, 2023 @08:00PM (#35283263)
>to make the reviewer feel like they are contributing

I swear maybe 50% of review comments are either to make the reviewer feel like they aren't a rubber stamp or just to signal that they actually read the PR.

Re:On Trust in Software Development by JackMorgan on Thursday March 23, 2023 @10:36PM (#35284368)
I completely agree with you. The sad thing is I've almost always seen management understanding the value of pair programming, but the devs hate it. It's so rare to find developers who are willing to pair for even half the week.
Re:On Trust in Software Development by dhab on Thursday March 23, 2023 @10:37PM (#35284377)
I agree. I am a dev, and I have done pair programming few times now. I am not sure I got the value that was hyped. I'd use that selectively on some nutty areas, and address things more broadly by introducing the "waste" of having to do code-review and KT later.
Re:On Trust in Software Development by dajonker on Friday March 24, 2023 @02:30AM (#35285714)
I agree about code reviews not being done "right", for my own subjective opinion of what a "right" code review is. I've been in situations where code review was required but effectively useless. Some would only focus on code style and completely miss obvious logic errors or lack of new tests. Some would blindly approve anything. Sometimes a manager would override a critical code review because a new feature had to be released urgently (and of course it turned out things were indeed bad later). Sometimes a one character bugfix would be blocked for an hour by the lack of code review.