Mistakes I see engineers making in their code reviews
(www.seangoedecke.com)
from codeinabox@programming.dev to programming@programming.dev on 26 Oct 17:06
https://programming.dev/post/39714887
from codeinabox@programming.dev to programming@programming.dev on 26 Oct 17:06
https://programming.dev/post/39714887
#programming
threaded - newest
Good, I just partially disagree with the 5-6 comments per PR. The number of comments is usually proportional to the number of changes. 10 comments in a 300-line PR seems excessive. 20 comments for 5k lines doesn’t.
Sure I can just shrug it and say I’m not reviewing a 10k line PR until it’s split, but that’s not very helpful either. So I just leave more comments and if they think it’s too much, I’d encourage them to open a smaller PR next time.
Is it? I feel there’s some threshold where a big enough change sails through unimpeded if the requester is sufficiently liked.
While I agree with the later (or middle?) points, maybe for different reasons or maybe I would have reasoned differently, I mostly disagree with the earlier points.
What kind of comments are they using?
When I leave comments on GitLab they’re threads that get resolved explicitly. GitHub also uses resolvable threads. The assignee/creator goes through them one by one, and marks them as resolved when they feel they’re done with them. Nothing gets lost like that.
I also make use of ‘⚠’ to mark significant/blocking comments and bullet points. Other labels, like or similar to conventional comment prefixes, like “thought:” or “note:”, can indicate other priorities and significance of comments.
I kinda agree, but I often leave the comment on the/a code in question, and often add a code change suggestion to visualize/indicate what I mean. This comment may stand in and refer to all other occurrences of this kind of thing. It doesn’t have to apply exclusively on those lines.
I make sure that my team has a common understanding of, and the comments adding sufficient context/pretext to make it clear, that code change suggestions and “I would have [because]” are usually or in general can be freely rejected, unless specified otherwise. Often, comments include information of how important or not changes are to me, in comments themselves, and/or comments summarizing a review iteration (with a set of comments). The comments can also serve as a spark for discussion about solutions and approaches, common goals or eventual goals of the changed code that may be targeted after the code changes currently under review.
I wouldn’t want to do it like that, specifically. It’s a question of weighing risks and medium and long term maintainability vs delivery, work, changeset, and review complexity and delay. Rather than “will this work”, I ask my self, “is this good enough [within context]”.
Maybe I’ve had too many juniors to get into this mindset. But I’ve definitely had numerous times where I did many comments on reviews, even again on successive iterations. Besides reviewing the code technically, the review can also serve as a form of communication, assimilation, and teaching (project an codebase at hand, work style, and other things).
It’s good to talk about concerns, issues, and frustrations, as well as upsides of doing so and working like that. Retrospectives and personal talks or discussions can help with that. Apart from other discussion, planing, and support meetings, the review is the interface between people and a great way to communicate.
Thank you for introducing me to conventional comments! I hadn’t heard of them before, and I can see how they’d be really useful, particularly in a neurodiverse team.