Live data from Hacker News

No code reviews by default

raycast.com

101–110 of 315 posts

Re: No code reviews by default

#101
post #32
post #15

This can not be posted too many times. https://www.youtube.com/watch?v=4XpnKHJAok8 Linus Torvalds talk on Google about how GIT is more a way of working then a piece of software. Everybody commits upwards in a tree of trust. If you do it this way you get automatic code reviews and in any team someone should be responsible for the "product" anyway and highest up in the hierarchy.

It's a great example of how Linus has a massive blind spot for the failings of the git model. He's "sorry" they use Perforce. Git is "better than everything else out there" but he doesn't mention Perforce. And yet, the Perforce model is the one that got Google to be one of the fastest-moving organizations on the planet, with the biggest code base.

> the Perforce model

I've used both Git and SVN enough to understand how a VCS might change how an organization creates code, but I've never used Perforce. What is "the Perforce model"?

Re: No code reviews by default

#102

> Pull requests don't prevent bugs. I remember once I was giving a talk on code review and I said that code review doesn't prevent bugs and people were shaking their heads. Everyone hangs on to this one thing, but if you look at the majority of pull requests that have been approved you'll see a lack of comments about pontential bugs. Also, if you do see a comment about bugs they'll often be disregarded. This drives m…

> I remember once I was giving a talk on code review and I said that code review doesn't prevent bugs and people were shaking their heads. Everyone hangs on to this one thing, but if you look at the majority of pull requests that have been approved you'll see a lack of comments about pontential bugs.

that's because the UX for github PRs sucks. Use Gerrit instead. It's not as pretty but it's super productive.

> I think the biggest problem with code reviews is it often becomes adversarial and people want to come out on top. I've had it more than once that someone has suggested another way of doing something, when I asked what the benefit of that way was or what was the downside of the way I was doing it no answer was forth coming however I was expected to implement their way. This becomes enraging when you point out flaws in their way but they can't find any benefit of their way.

that's not a problem caused by code review, it's caused by people who don't know how to work with others (or otherwise simply refuse to). to the degree that the code review process shines a light on this, that's good news, because that's a people problem that should be fixed.

> As well as, often people just don't want to do the extra work. You point about a bunch of small improvements. It's a pain.

when you look at a code review and you see problems in what's there, catching them in the code review is great, because that means less chance of having to fix it later.

if you see a code review and nothing's wrong with it, you just approve it. sometimes you can note things as "nits", meaning, fine for now but maybe next time do it this way.

> You end up with people asking for code style changes even tho there is a code style and the changes they're asking for aren't in those guidelines-

syntactical style and formatting should be automated, if not with tooling that actually rearranges the code in that way (e.g. [black](https://github.com/psf/black) for Python) then at least including well tuned linter rules. We use black, my own zimports tool for sorting imports, flake8 with four or five plugins as well as "black check", so we spend exactly zero time dealing with anything to do with style or code formatting, including having to even type any of it. if people are fighting over code style then there need to be tools that lock all of that down so there's no disagreements.

> People know it's a good thing to do but people have no idea how to code review and what is and what is not benefical during code review.

I work on the Openstack project and that is where I learned to do code review with Gerrit, it is completely essential for large projects and is an enormous productivity enhancement. Decades ago before CVS was even invented, the notion of using source control seemed crazy to me. That position was obviously insane, even though we were stuck using Visual Source Safe at the time. That's how it feels to me to be doing a real project today without code review and formatting tooling in place. Like even for myself, if working alone, for a large project with lots of changes I still use a code review tool, just to review myself.

Re: No code reviews by default

#103
post #25

Earlier quoted context omitted.

Meh. If 90% of the time it's a mindless ritual there is probably a better way to achieve the same goal. Code reviews are a huge time sink, especially for unimportant style- and naming nits. Code review as mentoring can be great, if it's a directed 1:1 effort. Usually, it is not.

>Code reviews are a huge time sink, especially for unimportant style- and naming nits. This isn't a problem with code reviews, this is a problem with your team's processes that code review has highlighted. These problems will show up in others ways if not during code reviews since clearly there's strong disagreement on coding styles and conventions. So go and fix or implement the style guides, linters and so on. This…

> So go and fix or implement the style guides

How do you make this converge across dev without endless debate or resentment ?

> linters and so on.

What happens when a rule has to change ? update the entire codebase impacting everyone with conflicts ? tolerate divergence existing code ?

Talking about thermometers, are you actually tracking fevers, or merely minor bad breath ?

Re: No code reviews by default

#104
I think I largely agree with this article.

When I worked for Apple, we had a strict "all code needs to be reviewed" policy, which I had no problem with. Then, after being there for about 1.5 years, I make a PR, ask two different people to approve it, which they do, and it gets merged. A week later, the code is released, it looks like my code caused a fairly major bug.

My manager's manager and my manager had a meeting with me, and told me that this was unacceptable. I ask "what exactly was I supposed to do differently? Clearly this bug was sneaky enough to where two other people also didn't see it." Their response was "the code needs to work, you wrote the code, the code was sloppy. This is your fault." Apparently they took the bug pretty seriously, since it was actually mentioned in my yearly review.

This is fine, I probably should have tested the code a bit better, but it always annoyed me that my "sloppy" code managed to pass code review [1], and yet I'm the only one to get in trouble over it. If the PRs aren't catching bugs and I still am going to get in trouble, then I'm failing to see why I should bother waiting an hour for someone to look through it. Instead, why not make it so we can merge quickly, test it quickly, and revert it if something breaks?

[1] Obviously I'm biased here, but I honestly think that in this particular case I was pretty easily the least-liked person on the team, and it was easier to throw me under the bus than anything else.

Re: No code reviews by default

#106
post #100

Earlier quoted context omitted.

IMO code reviews are a tool for mentorship and keeping architecture in line

They can also be used for bullying, micromanaging and other social constructs

something, something, quote about all tools being able to be misused.

Re: No code reviews by default

#107

I think I largely agree with this article. When I worked for Apple, we had a strict "all code needs to be reviewed" policy, which I had no problem with. Then, after being there for about 1.5 years, I make a PR, ask two different people to approve it, which they do, and it gets merged. A week later, the code is released, it looks like my code caused a fairly major bug. My manager's manager and my manager had a meeting…

You had shitty management.

Re: No code reviews by default

#108
post #7

He mentions "trust" a lot. Is that why we do code reviews, because we don't trust each other? I find this attitude problematic. We do code reviews because humans make mistakes. Requirements can be misinterpreted. Different work in progress can be in conflict with each other. Reviews are a good way to learn from each other and keep abreast of what work is occurring outside your own bubble. Not doing code reviews becau…

Trust but verify

Re: No code reviews by default

#109

I think I largely agree with this article. When I worked for Apple, we had a strict "all code needs to be reviewed" policy, which I had no problem with. Then, after being there for about 1.5 years, I make a PR, ask two different people to approve it, which they do, and it gets merged. A week later, the code is released, it looks like my code caused a fairly major bug. My manager's manager and my manager had a meeting…

You had shitty management.

No argument here. I should probably have switched teams, since some of my friends who are still at Apple seem to have had a better experience.

Re: No code reviews by default

#110

I think I largely agree with this article. When I worked for Apple, we had a strict "all code needs to be reviewed" policy, which I had no problem with. Then, after being there for about 1.5 years, I make a PR, ask two different people to approve it, which they do, and it gets merged. A week later, the code is released, it looks like my code caused a fairly major bug. My manager's manager and my manager had a meeting…

> test it quickly

Yes, in your scenario the lack of testing stands out as the major opportunity for improvement. If a bug is so important that it's mentioned in a performance review, then it's important enough that there should be tests that would have caught it. Automated preferably, or manual if necessary.

And everyone involved with the software, from you on up and sideways, should be calling for this testing. It's clearly important / worthwhile!

Post reply on HN