Live data from Hacker News

Ask HN: Does "trust" eliminate the need for code reviews?

news.ycombinator.com

41–50 of 77 posts

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#41
I would say no.

It has nothing to do with trust, if I make code reviews a must have. Everybody makes mistake, no matter how good they are.

Trust is build, that even I'm the CTO and one of the founders, I also cannot push stuff, just because I like. I have to go through the same process as all others. Code Review and QA. No shortcuts.

This gives my people the idea, that I do trust them to check even the "big boss" of the company and yes I have to fix my shit, if they find something.

Because it goes back to my first point: Everybody makes mistakes and there is nothing bad about it.

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#42
post #18

To me, there are two main reasons to review code (before merge): quality and trust. Quality should come way before trust, because if you don't at-least-mostly trust contributors then there's something wrong that code review won't fix. And if you think anyone is likely to go back and review already-merged code for quality when your manager is pushing for "velocity" (especially as it probably works, to some extent), we…

You are on the money, but I think quality is much more subject to automation than trust is.

On a previous team, implementing team-wide autoformat-on-save and a decent linter eliminated ~75% of code review feedback overnight. If your code reviews are mostly enforcing cosmetic properties of the codebase, automate that shit.

You have similar levers to pull in other areas. Fail the PR if the test coverage drops, add warnings on branch complexity...

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#43
Code reviews have absolutely nothing to do with trust. If you don’t trust your team members, then the team is inherently dysfunctional. Code reviews won’t fix that.

I’m in a team where members have a very high level of trust yet we’re still very strict on code reviews, because it helps catch mistakes, things that were forgotten or makes sure things were thought about. It’s a quality gate as well as a knowledge sharing tool (both from reviewer to reviewee and also about the code changes being made). None of these have anything to do with trust.

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#44
I was a code review skeptic. I changed my view after seeing the impact it's having on my current project. We've prevented a lot of bugs, improved how we communicate and actually trust each other more as a result.

Yes, it's slow at the start but the review process made sure there's context and a common pattern emerging, which over time pays off in velocity. We have little tech debt. I wish I could say the same about merge first. It's really not about trust at all.

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#46

Test first, review later. A quick skim of the code with a live test in some staging environment before merging is good enough

Had to scroll down a lot to find this. Developers should be able to easily test their code, if needed, merged into a staging branch somewhere, which can be easily rebased or cherry-picked into production.

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#47
NO GOD NO

Code reviews are not about trust. They are about 1) educating your teammates on the whole codebase slowly, PR by PR, 2) a second pair of eyes on your solution to a problem (perhaps it could be solved another way simpler or perhaps there is a subtle bug)?

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#48
Code review is a means of enforcing higher level, more important software development policies. Is there a design for this? Does at least one other person understand why this is being done? Does at least one other person understand what these changes could break?

Code review protects from sloppy thinking and poor planning very easily. "I don't know what this is, or what it does, where is the design for this?" pumps the brakes on those sorts of changes.

Code review as a means of ensuring code quality (whatever that means) is secondary, and it requires much more of a time commitment on the part of the reviewer. This is what can make code review slow, and this is the fat to cut, to make code review faster. It's probably not worth 45 minutes of developer time to generate a vast plethora of nit picks and discussions about what is idiomatic. For a new hire / junior engineer: maybe worth it. Under steady-state conditions: definitely not.

Re: Ask HN: Does "trust" eliminate the need for code reviews?

#50
The linkedin post states: "Build a culture of trust around xtreme programming practices; namely continuous integration."

I interpret that as saying: trust the process (of xtreme programming), not trust the other developer (to be a superhuman that never creates serious bugs?).

I'm more curious about the details of how to organize this than any principle objections. Let's assume we are going to do review-after-merge, what would it take to make it successful? I think its a good thought experiment.

I'm assuming we want most, if not all of our changes that are going into production to be reviewed. So there's this branch that is getting constant updates of unreviewed code, lets call it trunk, from which we want to do a release, but we want all those unreleased, unreviewed commits to be reviewed before the release.

How to keep track of what has been reviewed and how often do you review it? Will you review a massive diff with unrelated changes every once in a while and freeze trunk while doing so? Or will you review individual pull requests as they were at the time of merging them? Will you review collectively?

I guess it depends on how often you want to release and with how much risk.

Post reply on HN