Live data from Hacker News

The primary purpose of code review is to find code that will be hard to maintain

mathstodon.xyz

41–50 of 193 posts

Re: The primary purpose of code review is to find code that will be hard to maintain

#42
I work with someone who tends to rejects PR suggestions. I also work with someone else who accepts suggestions.

I think that the for the person who accepts suggestions, it's made me wonder if they accept them in part to share ownership with me. I feel like we both maintain and understand the code, and are on the same page.

For the person who rejects PR suggestions, it makes me less inclined to participate in those PRs. Why spend the time doing a thorough review if it's going to get rejected anyways.

Re: The primary purpose of code review is to find code that will be hard to maintain

#43
post #6

My attitude has always been that code review is best thought of as the gate where code goes from being owned by the author to being owned by the team or project. The code I'm reviewing is not your code, it is code that is about to become our code. Maintainability is a major factor in that, of course.

Such a luxury, I am envious!

Our team started using AI, so I switched to a simple method: no comments, and a binary "is this batshit crazy or passable" approval decision rule.

Saving myself time and sanity.

Re: The primary purpose of code review is to find code that will be hard to maintain

#46
I don't know about many people, but the author for sure doesn't understand the primary purpose of code review.

If the primary purpose of code review is to assess maintainability, there is no need for review, that can be done by automated tooling (formatting, bad naming, cyclomatic complexity etc.)

Re: The primary purpose of code review is to find code that will be hard to maintain

#48
post #13

The author is a mathematician, so when he says “it is not in general possible to find bugs by examining the code” he does not mean it is completely impossible to find bugs. He means only that it is not possible to find all bugs or even any particular bug.

Ofc you're correct in that sense.

I would add that (related to your "maintainability" point) ensuring the code is as simple as possible, and thus much more likely to be "debuggable by review", is a goal of review. Even that won't prevent bugs in the absolute sense, as you rightly say, but it boosts your probabilities.

Re: The primary purpose of code review is to find code that will be hard to maintain

#49
Well, we are dumb and we make stupid mistakes, and code review can find and fix them sometimes. I am very surprised that the practice of "review" is not more widespread. For example when I see medical doctors going YOLO with their patients, ppl driving excavators, etc.

Re: The primary purpose of code review is to find code that will be hard to maintain

#50
post #23

What if I told you that understanding what it is doing and finding bugs is actually the same problem?

This is largely my take as well. When I review code, I am checking for correctness. If I find something is not correct, that's a bug (or a bug waiting to happen). If I can't understand whether or not something is correct, that's a problem. If I don't know what the correct behavior should be, that's a problem.

Though I do think there is value in the original post. Re-framing is a powerful creative tool when you hit a mental dead end. And the responses let people share the other benefits that change management can bring.

Post reply on HN