When a code review hits me with "Why did you write it this way?", I'm honestly depressed all day.
Honestly, the logic works, but when a reviewer asks why I wrote it this way, it just makes me feel like I'm incompetent.
I think, "Isn't it fine as long as it works?" but they're also right, so I can't even argue... How do you all shake it off?
9 answers
Fr... so I'm not the only one who burns a whole day on that one "why"
But a lot of the time, that’s not the reviewer’s fault—it’s a problem with how the question is phrased. "Why did you write it this way?" feels like you’re asking with the answer already decided, so it puts people on the defensive. When I switched to "Have you considered other approaches for this part?" during reviews, the team atmosphere improved a lot. Even the same feedback feels completely different to receive.
Well, that's a bit... Rather than asking why the reviewer is being like that, isn't the real problem that you can't explain why you wrote it that way yourself? "If it runs, it's fine" is a really dangerous mindset. By that logic, you don't need tests and you can name things however you want lol
Got a source? Did that reviewer actually say that, or is that just something you heard?
I used to get pretty depressed after hearing that too, but these days I practice framing review comments not as "an evaluation of me" but as "an evaluation of this code." Specifically, when I get a comment, I check only two things: ① Is it a valid point? ② Is it worth fixing right now? If neither, I just resolve it and move on. This is surprisingly effective. Reviewers are human too, and a lot of the time it's just personal preference, so you don't need to accept everything.