Thanks to Justin and the comments on his post (No, Be a jerk), for expanding on my blog post and taking the discussion to a much more sophisticated level than I started. Instead of “Don’t criticize code”, I think this will be more suitable title of the paragraph: “Give constructive criticism”. I agree completely with Justin that refactoring itself is a kind of criticism. And it’s the constructive kind.
I also agree with Clinton’s point regarding team dynamics. Communication is important to write better code might not be well-received by your pair if you make him/her defensive, even though your point is clearly uttered and makes total sense.
Depending on your pair’s personality, criticizing the code could sometimes lead to a healthy debate, but other times could lead to too much negativity and too much judging. I’d say that I’ll try to keep my pair engaged (being a jerk or not), do the necessary refactoring, while keeping a positive vibe. Then I think it’ll pay off well to the code base, and to the team, in the long run.
