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
I disagree. The point isn't that the logic just needs to work; what matters is that it's maintainable, and the reviewer was just pointing that out. I get why that would sting, but if you blame the review culture for it, there's no growth.
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.
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.
I actually appreciate that question. In the moment it pisses me off, but later, when I look at that code again, there are quite a few times when I think, "Ah, so there was a reason I heard that back then." Of course, the tone is the problem.
Oh, I didn’t know about this. I should try that comment separation method too.
Just clock out and eat fried chicken lol. Seriously, try asking the reviewer back: "Was there a specific part that bothered you?" Most of the time, they'll say, "Oh, it's not that," and then tell you specifics. An abstract "why" usually means even the reviewer can't clearly put their finger on it, so asking back makes the conversation much more productive. After I learned this, my review stress was cut in half.
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