Egoless Programming #10: Critique code instead of people

In 2001, Lamont Adams of TechRepublic chiseled what would become ten commandments of Gerald M. Weinberg’s timeless wisdom: Egoless Programming. Today we’re going to learn its tenth commandment:

Critique code instead of people.

This final commandment was added in 2006 by Brendon Chase in a rerun of Adams’ original article. I think it’s a great addition, as it compliments the second commandment: You are not your code. That commandment taught us to not take criticism of our code personally. This commandment reminds us to be kind to humans but not to the code.

Let’s contrast some right and wrong ways to provide critique:

YES: This code won’t scale.

NO: You don’t understand scalability.

I understand scalability, and I often intentionally write unscalable code. If it doesn’t need to scale (yet), why place my focus there?

YES: This code doesn’t use library X correctly.

NO: You don’t understand how to use library X.

I can’t count the number of times I’ve mishandled a library, even one I’ve used hundreds of times and understand well. Show me what I missed, and help me use it correctly.

YES: This code doesn’t handle an edge case.

NO: You never remember to handle anything but the happy path.

Chances are high that I simply missed it or forgot to handle it. Don’t make me feel worse by branding me as sloppy or forgetful. Just help me add the necessary guards.

YES: This code doesn’t follow our team’s conventions.

NO: You don’t write code like the rest of the team.

Transform a moment of exclusion into one of education. Rather than shaming me for not fitting in, teach me why the convention I missed is important.

No matter how hard you try, you can’t hurt the code’s feelings.

So tear the code down and build me up.

Previous
Previous

Keeping a Dev Log 101

Next
Next

Egoless Programming #9: Don’t be the uncollaborative coder in the corner.