Top
Best
New

Posted by ColinWright 12 hours ago

The primary purpose of code review is to find code that will be hard to maintain(mathstodon.xyz)
319 points | 160 commentspage 5
ChrisMarshallNY 9 hours ago|
It's also important to help other members of the team to learn and understand.
othmanosx 10 hours ago||
I think you're missing the point of code review. By the time when the PR is ready to merge, discussions around the architecture and how the code should be structured should already be part of the tech design of a given feature. So the discussion around whether a A feature is built and planned in a maintainable way, should be way before a PR is filed. A PR review is making sure that you verify against the already agreed-upon structure, making sure everything matches the plan, and also find bugs and stuff that was missed, according to the plan.
high_na_euv 10 hours ago|
Not every codebase project etc use such workflow

Also such approach doesnt work with bug fixes / regressions

othmanosx 10 hours ago||
Every team should follow a plan, fine on a side project, but if you work in a large codebase with a bunch of devs, you need to have some sort of workflow to avoid stepping on each other's toes.

bug fixes are supposed to be small, contained, if they're rearchitecting the codebase, then they're not _bugs_, but tech improvements, and need to be addressed differently and I agree that this should be flagged in the PR.

a PR review is the final defence line before a QA

munksbeer 8 hours ago||
Look at the state of the comments on that thread.

"This is completely false! Code is review is to ..." proceeds to state an opinion.

Sometimes, some days, I just look forward to not having to deal with programmer hubris ever again.

nacozarina 6 hours ago|
I remember a time when the sole point of code review was to answer the question 'is this change going to break any other work currently in-progress?' That was it.

it was expected to be a short-duration fixed-scope activity with a clear Go-NoGo answer, and you would have gotten roasted for digressing into navel-gazing and distracted conversations about armchair philosophy. if the change worked as-advertised and didn't break your work, then it was a 'go', get back to work...

pjmlp 9 hours ago||
In most projects I worked on it is plain burocracy to ensure the solution architect is happy with their hexagonal or clean architecture.

Really I can count up to five the amount of projects where good code review actually took place.

moebrowne 9 hours ago||
> If I work until I'm exhausted and find three bugs, someone might still complain later that I missed a fourth and I should have tried harder.

This is a weird take. Less bugs is less bugs, just because you maybe didn't find them all doesn't undermine the value of finding some.

jerf 10 hours ago||
One of my favorite little things to notice is when everybody thinks they know what something is, and they all agree about it, but they in fact don't agree. In this case we have the statement "Code review is a good idea". What right-minded software engineer could possibly disagree with that?

But then notice 1. the number of people jumping up to say "No, you don't understand the point of code review" and 2. how what follows "The point is..." varies between so many different people. I can't quite say it's a unique take per person, as I've seen before, there are some common threads, but they are also not all the same answer by any means either.

In this case, there isn't a "the" point of code review to discuss. It turns out that while we all may have thought we were doing it for the same reasons, we aren't. This is real. We don't have the same goals, we don't have the same methodology, and thus, the value we get from it may be different. And in fact it is perfectly reasonable to discuss the multiple cost/benefits ratios that differ across the various definitions, because the simplification "it's good, end of story" is destroying important distinctions.

In this situation, it is helpful to frame this as a matter of the costs and benefits of the various options available. Forget the statement "code review is good"; it is fallacious to start with that statement as an axiom and then argue about whether or not your definition of "code review" is or is not the "correct" definition so that your definition gets the "good" attribute applied to it. Consider the options directly.

(I have to admit I've used this effect in anger... in meetings where I can tell that everybody thinks they know what some project is but I can tell they all have a different definition of it in mind, but I also know it's not going to happen anyhow, I don't chase down the differences. Sometimes you can use this to your advantage to cut short what would otherwise be a quite interminable, yet ultimately pointless, meeting.)

win311fwg 3 hours ago|
> What right-minded software engineer could possibly disagree with that?

No matter what "code review" ultimately is intended to mean it will have tradeoffs making its use a bad idea at least sometimes. There is no engineer who could agree with that statement. Suffice to say that the software industry attracts a lot of non-engineers, however.

lukasco 8 hours ago||
This is the big thing I'm struggling with:

Code reviews are still a critical step in most workflows. Though seems like everyone uses them for a different purpose: extra pair of eyes to meet a regulation/security, style police, and what this one says: maintainability.

And at the same time, code reviews are now a massive bottleneck in the development pipeline. Frankly, in a lot of teams they have been that for a long time. Though many would argue it was the only thing stopping absolute crap going into production.

But in a world where none of us writes code anymore, and I think we're there, even if the future is "just not evenly distributed" (Gibson), why should we have to do code reviews, the worst job of all?

Leaves me thinking that code reviews will land in the dustbin of history.

But for now I don't have a better solution.

jibal 5 hours ago||
This absurdly cramped view already has significant pushback/refutation in the responses on mathstodon.
skywhopper 9 hours ago|
I would add to this other purposes of code review:

* to share knowledge among the team — if code has been reviewed then at least two people know about it

* to ensure the changes won’t cause problems with other systems or future plans — maybe we will be rolling out a new logging system soon and we don’t want to solve the problem in this specific way

* a chance for the reviewer and reviewee to learn something about the system or the code via the review discussion

* team coherence — code that’s well reviewed is a team effort. Working together on small things like code reviews helps teammates work better together on other tasks in the future

More comments...