Taking All Criticism in a Positive Light

This post started out with me thinking about constructive criticism and how this affects developers. The area I want to focus on specifically is code reviews and how they can be made more positive. Most constructive criticism advice focuses on how to leave more effective feedback. I feel it’s also immensely helpful to be able to take as much as possible from any criticism.

Problem

Early on in my development life my workflow went something like this:

  1. Create flawless code that’s a beauty to look at and is wonderfully self documenting.
  2. Pass the above code to a code review process with much fanfare.
  3. All the reviewers turn out to be trolls and mercilessly attack my code.
  4. I get defensive. Fight to justify my code and keep everything unchanged.

Now the result of this process is that the final step makes me sad and frustrated. I generally don’t want to be sad. So I wanted to identify what was wrong with the above process and improve my life (and hopefully my code).

Potential Causes

Maybe the problem is with step 2? So if I stop participating in code reviews I’ll be a happier person? Whilst this solution might give me the illusion of happiness. I won’t learn anything from my fellows and I run the risk of letting through some errors.

So what about step 3? Are all of my co-workers (or open-source contributors) negative trolls? It seems unlikely that I’m a special hero and only everyone else is a troll so we’ll skip this for the moment.

So finally maybe the problem is with step 4. Should I get so defensive? Is my defensiveness actually caused by a mistaken assumption in point 1 (and a little bit 3). This seems like a good place to start.

Solutions

So now whenever I receive some comments on a code review I try to follow this thought process:

Conclusion

Since following the above I feel like I’ve gained a lot more from the code review process. Now I’m not perfect, I still miss the point, I still get a bit frustrated and so on. However I’ve found that if I keep coming back to the points above I can extract something useful from almost all comments. This means my code improves, I learn new techniques and I generally get better at explaining myself. There are probably some points from this that apply to leaving more constructive criticism on a code review but that’s a topic for another day.

Thoughts? Comments? Contact me on mastodon!