3 ms·
I know how they feel. I often replace code and feel like it's attacking the author; and also feel like my own code is being attacked when it's replaced.
by sqldba 7y ago
I know how they feel. I often replace code and feel like it's attacking the author; and also feel like my own code is being attacked when it's replaced.
- afarrell 7y agoWe should have some more common script for telling a colleague "that you for writing this code. It has clarified the problem a lot." as we delete the code. Its hard because while we do recognize that the value and difficulty is in the problem-understanding, the code is the most tangible thing we produce and so it feels like the work.
- to11mtm 7y agoI think it goes both ways. In every shop I work at, I do ask WHY someone refactored something I have done. However, I do not do so with any malice. As you point out above, sometimes, that first writeup is a working implementation, and while important, the first iteration is often not optimal. Thus, asking why is useful because it helps us become better developers. Talking about the changes helps share knowledge, and, yes, when questionable changes are made, it can be a lesson for the refactor-er as well. And when I am the refactor-er... I will try to explain my changes in the PR. Usually with a polite explanation of why I refactored.
- IggleSniggle 7y agoThanks for mentioning this. It has literally never occurred to me that refactoring someone’s code might make them feel attacked. I believe in continuous refactoring and assume my colleagues do too, but I think I need to re-examine that assumption.