Video in progress

Strong Middle 🤝 Soft skills

A colleague rewrites a module you wrote without asking you. How do you react?

First I ask why, out of curiosity rather than anger: maybe they saw a problem I didn't. Then I agree with them, and with the team if needed, that big changes get discussed beforehand.

📖 Answer

The first reaction is usually the sting of "was my code that bad?" A Slack message written in that mood stays in the team's memory for a long time, so I wait an hour and read the diff carefully.

Then I ask myself two questions:

  • Is the new version really better? Maybe they fixed a race condition or collapsed 3 duplicate methods into one. In that case I admit it openly.
  • Or is it just a matter of taste: different naming, a different pattern, no benefit, while the code I reviewed and covered with tests is now broken?

When we talk, I don't start with "why did you do that", I start like this:

"I saw you rewrote InvoiceCalculator. I'd like to understand which problem prompted it, so I pay attention to it myself next time. Just one thing: if it's a half-day change, drop me a note beforehand, because I had an open PR in this module."

If it happened once, that conversation is enough. If it repeats, it's not a personal matter but a process matter: a CODEOWNERS file, a short issue or design note before a big refactor, a required approval from the module's owner in review. Then, instead of an "I vs. them" argument, there's one rule for everyone.

In an interview, this question checks that your ego doesn't outrank code quality. A good answer is this: the code belongs to the team, but asking people to respect boundaries is normal too.