Code Review Criticism
Debates on distinguishing code criticism from personal attacks, the role of ego in code reviews, and best practices for giving constructive feedback without offending developers.
Activity Over Time
Top Contributors
Keywords
Sample Comments
"You are not your code" When somebody is criticizing code you wrote they are doing just that, criticizing code. It isn't a personal attack and they aren't trying to hurt you.
A technical review of code isn't a personal attack. Please learn to tell the difference.
"criticism" is a bit broad, there's a few different scenarios:- If someone reports that my code crashes with some seemingly valid input, I won't take that as criticism, but rather somebody trying to help improve my code. It's for their own benefit, but still it's still a contribution.- If someone points out some stupid flaw in my code and has a suggestion on how to improve that, I'll also welcome it as a contribution. It's also an opportunity to lear
If your code review makes the coder feel personally attacked or embarrassed, you're not doing something right. Code reviews are meant for 2 (or more) way communications and discussions in order to hold quality of the code up to a standard, not a opportunity for the reviewer to feel superior and attack others. Commenting things like "this line is poorly written" is not helpful to anyone, instead try "do you x would be a better solution? because ".I
You first need to understand that you're probably wrong on a bunch of concepts about code.Programming follows some of the bad stereotypes of nerd culture (https://www.youtube.com/watch?v=Qam4iiya1q0).But no one really knows that much about all the technology world, and it is important to be humble about it. I used to be more arrogant when I've started programming, that was a sel
I’d say it’s wrong. What’s the point of having your feelings hurt when you could just work with someone who’s trying to improve things? If you agree things need to be improved then it is plainly irrational. Having feelings about your code (in the small or in the large) is a mistake.
This is not code review problem but huge ego problem. When you are discussing code you should always use technical arguments not personal attacks. Only bad programmers value their ego more than good advice from others. You should always use code review as opportunity to learn/teach new things not to fight or offend others.
Insulting someone's code is like insulting someone's kid. The guy probably feels he put a lot of thought and hard work into it. It's not that hard to give constructive feedback as opposed to being an asshole.
This advice is similar to the Hacker News Guidelines [1]Such as:> Be kind. Don't be snarky. Comments should get more thoughtful and substantive, not less, as a topic gets more divisive.or> Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something.and> Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith
We're missing context as to the existing work relationship. If this was one of the first interactions, maybe it was a little too harsh.Beyond that, even though I'm generally an asshole, I try to be nice in PR comments. Like it or not, most devs have some amount of ego tied up in their code. So removing the sting with some sugar coating makes for a better chance of them listening.None of this applies once I have a longer work relationship with the author.