My son just quit a startup because that had become epidemic. Couldn't get emergency code committed; couldn't meet (artificial) deadlines for demos and shows; every choice yammered over for esoteric reasons.
I suggest to everyone: when you make a comment in CR, also approve the commit. Trust the engineer on the other end to do what is necessary and responsible. If that become a problem, address it then. It seems like the minimum in professional respect.
Let me say this because I don't see it often said. Coding guidelines & Code review are a balancing act. One without the other is useless. Code review is where the correctness of the code is verified and we make sure that the guideline is followed. Without a guideline, the review process is just opinions. A guideline but without peer review is just a waste of time too. Guidelines must be reviewed often, it's a living document, that must be continually revised if need be to match the team and development process.
If your guideline calls for indentation by 2spaces and you use 4, it's not harassment, it's a violation of understood principles.
Now I must agree that the CR process should not be a bottleneck, if it is, it's a symptom of a bigger problem with the team and leadership. It's the leaders job to identify whatever it is and clear it so it can be fast and efficient.
You're a professional you should be able to defend your code, and explain your reasoning. If you can't, you need to change it, and you'll improve at the same time.
I mean most changes in code review only take 5 minutes to rectify, so I often don't buy the time argument.
If you getting bit architectural change problems in your code review, you obviously didn't collaborate with the team very well... People should roughly know what your approach is before the CR even arrives at their door
I don't hate CR. Someone below explained it better than me, that different people see the code differently. And you should respect that someone wrote it that way and not try to force your way upon them.
> If you getting bit architectural change problems in your code review, you obviously didn't collaborate with the team very well... People should roughly know what your approach is before the CR even arrives at their door
I agree with it a lot. I think that would solve a lot of problems, but not necessarily the small ones.
Here's a litmus test: if the comment has nothing to do with the correctness of the solution to the ticket, then don't comment. Instead write another ticket to address {whatever}. If it doesn't rise to the level of a ticket then guess what - you're being pedantic.
I've noticed this outside of the CR process as well. When people are tasked with providing a critique, it's as if they feel obligated to say something because they're treating the task as "find something wrong with X" not "determine if anything is wrong with X". Sometimes it seems like people trying to exert their power, but often it's more like people are just trying to prove that they're adding value.
If you work with people like this a lot, try introducing a shit sandwich to your company. Before you call your caterer, let me explain what that is...:)
My Dad taught me that when you have to criticize/correct something, do so in a shit sandwich. Start off with positives, then express your criticism and then end with positives. Thinking about positives tends to ground people and get them to evaluate the situation, not merely come out with negativity to prove their worth...
I agree wholeheartedly with this. One of my biggest pet peeves right now is having PRs delayed from merging because I can't get the required approvals over tiny non-vital changes.
IMO a code review should only ever be rejected / not approved if it a) will bring down prod upon being committed, b) contains easily correctable but serious oversights (bad run time algos, potential NPEs, etc), or c) is built in a way that is not easily transferable / maintainable / goes against establish patterns by the team.
Too many people use CR as a way to gatekeep and show off. I'm all for discussion, possible improvements, exchanging opinions, and learning - but not at the cost of leaving PRs in CR status for days on end.
When we do code reviews, we try to make things explicit. What needs to be changed, and what am I just commenting on to illustrate a different way to do it.
Sometimes code is just wrong (either at the micro level--you forgot to remove that debug line--or at the macro level--you forgot this edge case) and a second set of eyes is a great way to catch it.
But I agree, treating the original developer as a professional is a good idea.
- You understand both options.
- You understand the tradeoffs between them.
- You have a reasoned argument for favoring one approach.
- You suspect that the other person is missing some of this information.
I love getting comments that teach me about a language, API, design patterns, or potential bug, and make my code better. Even if I'm going to stay the course in this particular case, I'm happy to have received the comment, and always try to let the commenter know that. An okay code review gets my code landed fast, a good code review is one I learn from.
But I can't fucking stand defending and explaining perfectly normal and reasonable choices to engineers who just don't know and are curious, or have weird taste, or are otherwise putting me through the exhausting exercise of fighting for every little choice without providing value in return.
Often times when I'm reviewing code, I'm learning as well. If I ask a question because I don't know and am curious, I'd think that's a good opportunity for knowledge transfer. Why can't you fucking stand it?
edit: it occurs to me that this comment is extremely meta, hah.
Observe, reflect, try stuff out, solicit feedback. Run that cycle with the highest quality and quantity inputs you can find. It's absolutely your senior colleagues' duty to help you develop the aesthetic sense, but the higher quality and more cost effective way to do that is by giving feedback on your work.
Similarly on point 7 I get very excited about new tech ( or similarly with cool old stuff i've only just discovered ). Who needs to be paid to be passionate about what benefits new tools may bring for me or the team :)