News for hackers. Stuff that matters.
Re:Code Review Can Be Better by liampulles on Thursday August 21, 2025 @02:42AM (#44969778)
Here's an alternative I've wondered about: Instead of one person writing code, and another reviewing it - instead you have one person write the first pass and then have another person adjust it and merge it in. And vice-versa; the roles rotate.

Anyone tried something like this? How did it go?

Re:Code Review Can Be Better by mattikl on Thursday August 21, 2025 @02:52AM (#44969826)
I've noticed for a long time that if I have participated in writing the code under review, I'm able to provide much more insight. I think what you're suggesting starts from thinking the code as "our code" instead of my code vs. your code, which so easily happens with pull requests. And learning to work iteratively instead of trying to be too perfect from the start, which goes well with methodologies like TDD.
Re:Code Review Can Be Better by thinkindie on Thursday August 21, 2025 @02:49AM (#44969809)
That’s basically an async pair programming session, isn’t it?
Re:Code Review Can Be Better by liampulles on Thursday August 21, 2025 @02:50AM (#44969817)
Yes I think so. Have you tried it?
Re:Code Review Can Be Better by thinkindie on Thursday August 21, 2025 @03:28AM (#44970065)
Just cases where PR were submitted close to someone holidays and I assigned it to someone else in the team to bring it over the line. But otherwise I have worked with sync pair programming only.
Re:Code Review Can Be Better by whyever on Thursday August 21, 2025 @03:48AM (#44970210)
I know some people who do trunk-based development with pair programming: You write the code together, and once you are satisfied, you merge it to the main branch, from where it is deployed to production if the tests pass. It works well for them.
Re:Code Review Can Be Better by romanovcode on Thursday August 21, 2025 @03:29AM (#44970075)
Great idea, if you're fine with development time to take twice as long.
Re:Code Review Can Be Better by ramon156 on Thursday August 21, 2025 @05:56AM (#44970892)
The alternative is a merge that potentially has more bugs. Trunk based is definitely not twice as long, rather 1.5x on average
Re:Code Review Can Be Better by fogzen on Thursday August 21, 2025 @11:04AM (#44973687)
It might be worth it if it reduces bugs. If you’re running a payments company maybe working software is more important than saving a buck and shipping a day earlier.

Braintree was a pair programming company for example.

Re:Code Review Can Be Better by caspar on Friday August 22, 2025 @07:49AM (#44983370)
If you are used to PRs taking days (or over a week!) to merge, then I've found it's way faster to get someone to sit down and walk them through the code - which is not miles different from what's being proposed here.
Re:Code Review Can Be Better by 000ooo000 on Thursday August 21, 2025 @06:21AM (#44971020)
There's something to be said for reviewing code you've never seen before. When you're familiar with it, you lose the ability to be surprised, and sometimes "WTF?" is useful for a reviewer to think.
Re:Code Review Can Be Better by actinium226 on Thursday August 21, 2025 @10:37AM (#44973348)
I would want the first person to write 90+% of the code, and really more like ~98% of it, because at some point you need to just do your job. But I like the idea of having the reviewer make the relevant changes themselves and merge it in. That's more or less what we did at the first place I worked, and the expectation was that both of you were responsible for the code. If it was more than minor changes the second person could send you notes for you to implement, but they were always the person to merge. I prefer it to the alternative of chasing someone down so that they hit "approve" so that you can go back to your desk and hit "merge."