barbazoo
7 hours ago
> I’ve recently come across a discussion where a new developer joined a team and faced over 300 PR comments on their first contribution. Most of it was stylistic nitpicking. This isn’t just unproductive, it’s outright toxic.
For me this says more about the company culture than any inherent flaws with the code review process.
onion2k
2 hours ago
It says PR comments benefit the reviewer in some way, and they're not always left to improve the code or to help the person who opened the PR. For example, if you work in a culture where being seen to leave PR comments is seen as positive regardless of the quality of them, or even that code review is a tracked metric that contributes to your performance review.
That culture will turn even the most conscientious dev into a monster.
OptionOfT
4 hours ago
This is why I love things like cargo fmt / go fmt / eslint / etc.
No discussions of whether
if (foo) return;
is valid, or we should do if (foo) {
return;
}
theshrike79
an hour ago
Just having a valid .editorconfig for the project will do a lot for languages without gofmt.
hibikir
4 hours ago
That's also why I dislike it: The mind that will go apeshit over trivial style nonsense will still provide unhelpful feedback on other topics... but it will become far less obvious that their comments should be downgraded.
Formatters also do a poor job if your language is flexible and expressive. Great for go, but if your language is the kind that easily supports internal DSLs, formatters are not even helpful at making the code regular
Jare
4 hours ago
> it will become far less obvious that their comments should be downgraded.
I'm curious why you think this would happen... I would imagine that their comments will now have be to about things that matter, and if they are unhelpful they will stand out more.
Brian_K_White
31 minutes ago
It is obvious that a style comment is of no significance, and that the person who made it chose to spend time and personal capital on something of no significance.
It is not obvious that an actual code change is of poor quality.
To show that takes infinitely more experience, work to analyse all the direct and indirect ramifications of both the original and proposed approaches, capacity to push back and decide that your own engineering judgement is equal or better than whoever is purporting to correct you, willingness to suffer everyone else accusing you of arrogance for that on top.
Even with all of that, it's a lot harder to prove the valueless comment is valueless because the more you know, the more you know that practically every single line of code could be done 30 other ways with some valid argument for each one.
It's completely insidious both for the junior and the senior.
The junior has no way to know the junk comment is junk. So they internalize the comment and everyone is worse for it.
The senior has it almost worse. They know enough to know they don't know everything and the comment might be valid, so they put in all kinds of work to try to figure out if they actually missed something, did they have point etc. Maybe in the end the code doesn't end up as bad as the junior just rolling over, but it sucked for everyone and the challenge was not really an intentional productive crucible, it was just a douche that everyone had to waste time and energy taking seriously.
Only someone who actually is arrogant (whatever level, whichever side of the pr) has it easy. Again bad for everyone except them maybe.
mihaaly
3 hours ago
Who cares?!
PhilipRoman
6 hours ago
IMO the best way to handle stylistic choices (if at all) is to have the reviewer just adjust it themselves. Ping-pong with comments like "add empty line" is a waste of time for everyone.
yjftsjthsd-h
6 hours ago
Not just stylistic choices - I absolutely love the way ex. gitlab lets you do a suggested change in a comment, precisely because it lets me do all the work and the MR owner just has to click to accept if they agree. That lowers the bar for what I'm willing to bring up in the first place (though I personally still don't like to comment on matters of style or taste) while making it less work for everyone, which makes it much easier to give useful suggestions:)
mdaniel
3 hours ago
I like GitLab's feature of "suggested change" whereby the submitter can offer the change as a one-click "accept change" but importantly the change is still under the original author, because in any sane(?) review process, authors are not able to approve their own merge request. In your workflow if the reviewer checked out the branch, did the needful, committed, and then resumed reviewing they'd have locked themselves out of approving (err, assuming the aforementioned "authors cannot approve their own merges")
https://docs.gitlab.com/ee/user/project/merge_requests/revie...
https://docs.gitlab.com/ee/user/project/merge_requests/appro... and https://docs.gitlab.com/ee/user/project/merge_requests/appro...
paiute
6 hours ago
I like this idea, it has the bonus of revealing how much the reviewer actually cares. I bet half the things they wouldn’t take the time to fix themselves.
watwut
4 hours ago
IMO, the best way is to have automatic formatter shared by team.
EliRivers
4 hours ago
have the reviewer just adjust it themselves
Passive-aggressive minefield. Someone will see a change done to THEIR code, without the changer even asking, and it will feel like the person who did it is a passive aggressive dickhead. Resentment will brew, tempers will be lost. It will only get worse from there. Software engineers already aren't exactly known for their humbleness and ability to swallow their ego.
grecy
4 hours ago
> Ping-pong with comments like "add empty line" is a waste of time for everyone.
And any manager that lets it happen without severe reprimands to the time-waster isn't worth working for.
We've all got way more important things to be spending our time on.
herpdyderp
6 hours ago
This kind of feedback has largely been solved, for me / my team at least, with linters and formatters (as mentioned in the article). So I'd say it is still a reflection on the code review process being broken.
johannes1234321
4 hours ago
There is a lot of stuff a linter can't do, which however are stylistic choices some people care a lot about. Naming being a big one. Which terms to abbreviate how etc. Also there are a lot of things where automatic highlighting is possible, but any rule needs exceptions which a re subjective (nesting, usage of "raw" looos, early exit, ...)
Trying to get some consistency there can be good. And teaching new team members the "habits and traditions" may simplify long term maintenance.
However could review tools aren't a good place for distinguishing between "hey, this is good, but I'd like this slightly different" from "there is an actual issue" but that has to be solved somehow by communication. Which often isn't the best skill for engineers.
roland35
4 hours ago
Yes exactly! Reviews should not waste time with format - I would take the hour to set that up in CI and never worry about it again.
Or if that is too much (no shame!), just accept style differences.
SketchySeaBeast
5 hours ago
Yeah, if you care about it enough to stop a PR because of something and that something can be automated, automate it.
js8
6 hours ago
I think a good general advice when training somebody is - focus them only on the biggest flaw at the time. That's how I would proceed with a "bad" PR.
I would even accepts smaller issues (style) when there is a bigger issue to fix. People might eventually outgrow it.
eddd-ddde
6 hours ago
For me it's the opposite. If I'm making a PR, please point out ALL of the nits you can even think about. My next PR is bound to have at most 25% of that since by now I get more about what the team values and considers important.
collingreen
5 hours ago
This highlights something very important to me that sometimes gets lost when thinking about the tooling and that is the human element and the importance of communication, existing relationships, and rapport. The PR feedback I give and receive is extremely influenced by the relationship I have with the person - for some PRs any nit pick feels frustrating but I have other coworkers that can slam my code and even pepper in insults but our relationship lets me read it in the jocular and secretly constructive way it is intended.
The code is the same way and there was a great comment higher up about an ignored lint rule being an indicator of someone thinking about it and making a judgement call that this time the rule shouldn't apply. I have SOME peers where that my reading of that line of code and others where my assumption is the opposite and they were just lazy or didn't know how to do it "the right way". It's the same line of code!
I don't know how tooling will ever replace this part so I think it's important to keep it as the bedrock of any collaboration process.
znpy
6 hours ago
on a different side: it also tell you (a lot) about specific people.
I've seen good/great people call out the nitpicks (in my case it was often mis-spelling, due to not being a native speaker of english) but will approve the PR anyway (implicitly expecting another revision to be sent, trusting the submitter).
On the other hand bad/toxic people will drown you with stylistic nitpicks and won't approve (and trust) you to do your best work. You will be essentially blocked pending their approval (so that nitpicks are changed according to their likings).
The weird thing is that all this traceability leaves traces for management to see who's doing a good pr review job and who's not... But I've learned that management usually does not care much.
to11mtm
6 hours ago
It's tough with spelling sometimes.
In my current role I review a lot of PRs, they tend to be large due to the waterfall way things work... If I don't ask to fix the spelling now, It might not happen for a year or two. That said if it can be fixed in separate PR before release, that's fine.
Really, it's best to have some terms or explicitness.
For example, with my teams 'Nitpick' means I'm just being nitpicky, Doesn't have to change unless it's on the edge (and I'm explicit as to why it should change, i.e. I know the next thing will need the change anyway). "Consider" means It doesn't have to happen, but here's some food for thought. "PLZ FIX" is fairly self explanatory.
Also, making sure management (especially for contract houses) knows that PRs are a 'judgement free zone' and should not be held against people for perf reviews etc; that should be collected by other peer feedback channels instead.
dec0dedab0de
6 hours ago
* I've seen good/great people call out the nitpicks (in my case it was often mis-spelling, due to not being a native speaker of english) but will approve the PR anyway (implicitly expecting another revision to be sent, trusting the submitter).*
I always thought this was the best way.
I wish these systems had a way to assign severity to comments, and urgency to the commit.
If you have a jr developer it is your job to give them stylistic feedback, the problem comes from mixing it in with security holes or sneaky bugs. And when the process doesn’t identify when we need to ship it yesterday, vs in the next few months.
yjftsjthsd-h
6 hours ago
Depending on your company culture, you can also just explicitly write something like "This is not a blocker, but I would suggest...". Of course if your culture uses explicit "press the button to unblock" then that's probably redundant.
erik_seaberg
24 minutes ago
Half of my comments were "nit: consider blah blah" where I want it on his radar, but I approved anyway and if he declines I'm fine with it.
to11mtm
6 hours ago
Yeah I do similar and encourage colleagues/orgs to do the same.
fmbb
3 hours ago
barbazoo
6 hours ago
Agree. Why did the junior developer feel like their changes were ready to be reviewed. Looks like they had little guidance. Why didn't a senior developer suggest to close the PR, apply the formatting or whatever and then re-open the PR or something like that. 300 comments, that's either a lot of developers commenting or just a lot of back and forth. I don't get how anyone would let it come to that point. Makes me feel grateful for the places I worked at and the experience I have now.
rileymat2
5 hours ago
In many dynamic languages, depending on scope, spelling is not a nitpick, it has long term mental costs and very well can cause bugs.
vips7L
4 hours ago
Spelling automatically should be highlighted by the ide too. Spelling mistakes means you’re blatantly ignoring warnings from the ide.
prh8
6 hours ago
"will approve after nitpicks" is the most asinine behavior
bluefirebrand
6 hours ago
Honestly for me it tells me they need to hook up a code auto formatter into their workflow
Forget stylistic nitpicking. Enforce a code quality standard with a linter and formatter and be done with it
InvaderFizz
6 hours ago
I agree. Even within my own org there is some nitpicking, but it's almost always about style consistency for our shared codebase, which is valid.
If your PR doesn't pass lint checks, it doesn't get merged. And the only reason it would fail the lint checks is if your pre-commit hooks didn't fire.
There is no argument of 2,4,8 space vs tabs, because the code you commit is run through the linter.
Write however you want for the things that don't matter, the formatter always wins.
arp242
4 hours ago
It's impossible for any code formatter to be 100%. Where to put a blank line? Where to break a line? How to name a variable/function? etc. etc. Some try (e.g. prettier), and what you end up is frankly just bizarre code that's just ugly. Never mind tons of other small things that often don't really matter.
The solution is to just not be too anal about it. It really is a cultural problem.
For example a few weeks ago I reviewed a PR from a new team member; there were some seriously structural problems with his approach, so I commented on that and ignored all the small stuff for now. Another programmer on my team also reviewed at the same time, and only commented on the small stuff that, IMHO, don't really matter, and didn't look at the general approach at all (which really was just all wrong, and also quite obviously wrong).
Not to be too arrogant about it, but I feel this sort of stuff is what distinguishes a "good engineer" from a "mid engineer".
bluefirebrand
4 hours ago
> The solution is to just not be too anal about it. It really is a cultural problem
"Any proposal that requires everyone to just is not a solution, because everyone will not just"
People are anal. You aren't going to get them to stop being anal
A real solution is to have the team agree on a shared style guide, then enforce it with a linter and formatter. If anyone cannot come to an agreement with the rest of the team, or continues to be anal about things that do not appear in the style guide after this, then that person has singled themselves out and the company will need to find a way to deal with the behavior
I agree that good engineers focus more on the actual structure and problems instead of nitpicky things like formatting
That said, code cleanliness and consistency is important too. It makes codebases much easier to maintain and understand if everything is formatter consistently. It's a pretty mid engineer take to think it's not important at all
arp242
4 hours ago
You can't "enforce" all of these things. That was my main point.
And you absolutely can stop people from doing that. Simply accepting dickish asshole toxic behaviour as "well, people are like that shrug" and never telling people off is exactly the problem.
bluefirebrand
28 minutes ago
If you start telling people off at work, there is a good chance that you will be perceived as being the problem
If you go to management to complain about a coworkers behavior you may just be told that you have to adjust your expectations to get along with them
If there's a team agreement and someone continues to violate it then you actually have a complaint you can make to management that has some bite to it
The_Colonel
4 hours ago
This:
> "Any proposal that requires everyone to just is not a solution, because everyone will not just"
invalidates this:
> A real solution is to have the team agree on a shared style guide, then enforce it with a linter and formatter.
... since the "team" is everyone. It's basically the same problem.
The other issue is that linters/formatters don't "solve" all formatting/stylistic choices. Most formatters, fortunately, still allow you to choose where you do line breaks for example, since they do matter and shouldn't be arbitrary.
bluefirebrand
32 minutes ago
They aren't the same at all
A shared style guide is an external impetus to adjust behavior. It comes with external accountability, and also an implicit understanding that violating the shared expectation may bring consequences
"Everyone should just be less anal" is expecting an internal impetus to adjust behavior. There no external accountability, and there's no expectation that failing to do so has consequences
> The other issue is that linters/formatters don't "solve" all formatting/stylistic choices.
80% of a solution is better than 0%
wnoise
40 minutes ago
You're not wrong.
But in theory, agreement and buy-in is a one-time thing, while actually writing the code and reviewing the PRs are constant things.
barbazoo
6 hours ago
Oh 100%. Discussing style within a PR unrelated to changing the styling rules seems like a waste of time.
marcosdumay
5 hours ago
This. You either don't care about style or push the style automatically without any interaction. Every other option is bad to some extent.
But only use a linter if you will add your rules over the empty set. If you get a pre-built set and are expected to remove the ones you don't need, you are making a toxic environment.
DanHulton
6 hours ago
This literally what the article says.
chuckhend
6 hours ago
Automating this with linter and formatter is great. It moves the argument over style and format to a one liner change to a lint config instead of mingling it with the with the main code change.
bluefirebrand
26 minutes ago
It also hopefully only happens once.
If you continue to have people bringing up arguments over the linter and formatter after an initial agreement is made, then you can talk to those people
edflsafoiewq
6 hours ago
Style also involves things like "renaming variables", to take the article's example, which can't be automated away.
AlotOfReading
5 hours ago
There are formatters that will enforce the basic case/underscore rules of naming conventions. I haven't seen one for the actual text, but I can see how that might be nice if it worked reliably.