Live data from Hacker News

How to run a miserable code review

badsoftwareadvice.substack.com

101–110 of 122 posts

Re: How to run a miserable code review

#101
post #75
post #40

Earlier quoted context omitted.

Merge conflicts to the main branch? I've never even heard of an org where it's OK to force-push to main. That's wild! And a huge red flag, that ought to be fixed at priority zero. Wow.

Ah, but it wouldn’t be something as inelegant as a force push. No no. You do merge. It’s just that the outcome is slightly… biased.

OK, so we're talking about allowing PR merges without a +1 from a reviewer?

That's less-bad, but still a red flag :grimacing:

Re: How to run a miserable code review

#102

So many missed opportunities for a small business. A code review should never be done in person; instead all communication should happen asynchronously through passive aggressive messages left in GitHub. If you're on bi-weekly sprints, the review should be left to age for a minimum of 5 business days before any feedback is provided. Never write resolvable comments, but rather leave ambiguous musings of how a block of…

I never knew a code review until maybe the last 5 or 6 years of my career. Clearly I never shipped stable code in the first two decades.

Stable? Maybe. Maintainable in a business-continuity sense? Possible but unlikely.

Code review is an essential part of shipping sound software.

Re: How to run a miserable code review

#103
This is very funny but thank god not my experience at all. Code review should be, and is where I work, about making constructive comments and checking that the code does what its supposed to do. If at code review, people are really questioning the purpose of things and being obstructionist, an earlier stage of planning and design has already failed and code review itself is not to blame.

Re: How to run a miserable code review

#104

Earlier quoted context omitted.

What makes you call your current review culture “sane”? I’m not sure I have seen that yet in my career.

Prioritize code reviews over development work. Have SLAs. If you are assigned a CR, get to a good stopping place, pause your work, do the CR, and resume. Close CRs that have become stale due to submitter abandonment.

+1, every PR should ideally be reviewed within a day, and certainly within a week.

Re: How to run a miserable code review

#106

Also, if you have a bad manager who likes to gaslight you with questions that make you doubt yourself, a code review is a great way to pass on the good feelings to your co-workers. Make sure to ask plenty of leading questions that interrogate the competence of the author. The more passive-aggressive the better. And word it so that you can deny anyone that calls you out for negative behavior. I don’t understand this l…

The mark of a 10x dev is the ability to script an auto-gaslight-comment of “Are you sure that’s what you intended?”.

No better way to get a dev to question their sanity with a comment that makes them second guess their own goals.

Re: How to run a miserable code review

#107
post #95
post #55

Earlier quoted context omitted.

The best is when the only possible reviewer is your Engineering Manager because you have no other engineers in your domain on the team.

That's lucky to have a manager who even logs into GitHub. Many jobs of mine I have been my own approver.

I think it is a huge assumption to believe my Engineering Manager even has time to review anything within the next 2 weeks. Every time I have hit this at my company I have had a minimum wait of almost 3 weeks on average.

However, yea, against just approving your own code, this is better.

Re: How to run a miserable code review

#108
post #45
post #36

Earlier quoted context omitted.

> * CR feedback always has a specific action item that is easy to address Then CRs are pretty much pointless. The feedback I want as a senior developer is the complex stuff and that is half of the time not easy to address. The trivial stuff I usually, but not always, spot myself when checking the code before sending it for a review.

Reviewers are responsible for not just pointing out issues, but also providing (at a minimum) some form of direction, or (more ideally) one or more explicit suggestions as to how to resolve those issues. This is an essential component of a productive code review culture.

Yeah, a good review must explain why, and should ideally explain how it should be instead if it needs explaining.

* This code should be changed looks bad - not a good comment

* This code should be chabged because ten nested ternaries gets hard to read - better

* This code is hard to read because there are ten nested ternaries. Can we replace it with a helper method that returns one value using if blocks? - best, in terms of actionability

Re: How to run a miserable code review

#109

Code review is a flawed process, especially for junior engineers. You spend time and effort, maybe days of work, getting this to work, and then some know-it-all leaves a bunch of nit-picky comments or tells you you're doing it wrong. I tell most of the juniors I work with to work defensively against this using a few strategies: - smaller PRs. Break the work up any way you can. Make small tickets or submit your PRs wi…

This is backwards and why I think mandatory code review is a waste of everyone's time. Nobody should be writing code with the goal of passing a code review. They should be writing code that solves a problem and adds value to the end product. If you're writing a system that requires 5000 lines of code, it's a waste of your time to figure out how to break it up into 5 or 10 PRs (which might actually make it harder to r…

> Nobody should be writing code with the goal of passing a code review.

It's not backwards. Code needs to be readable, well thought out, bug free. Code review (done well) helps establish these points.

> If you're writing a system that requires 5000 lines of code, it's a waste of your time to figure out how to break it up into 5 or 10 PRs

I guess if you think those 5000 lines are perfect that makes sense. Often big PRs in my experience have a lot of issues that the authors and other reviewers will have trouble catching.

> Once they've demonstrated their ability to write good code, from that point forward you trust them not to screw things up.

Ha! I don't even trust myself not to screw things up.

Re: How to run a miserable code review

#110

Code review is a flawed process, especially for junior engineers. You spend time and effort, maybe days of work, getting this to work, and then some know-it-all leaves a bunch of nit-picky comments or tells you you're doing it wrong. I tell most of the juniors I work with to work defensively against this using a few strategies: - smaller PRs. Break the work up any way you can. Make small tickets or submit your PRs wi…

If the code review process is (through your supportive wisdom) pushing the people you work with to follow those practices, then I would argue it is actually a pretty good process. Those are all very good things to do, that a good code review culture should definitely be pushing people toward. For instance, let's imagine this without the code review process and your subsequent advice on how to make it go better: Peopl…

The problem is that reviewing is itself a skill, and many people are bad at it.
Post reply on HN