I regularly have codevs who say similar things to "why don't you just not make that mistake?" and "why not just do <insert crazy complex thing here> instead?".
I've taken to responding with: "Because you probably have more IQ points than me. I have fewer IQ points than you, so therefore I must do dumber and simpler things than you."
It's made some of their faces turn red in embarrassment, as they finally realized what unreflected belittling little dorks they were being.
I’m a bit allergic to questions that begin “Why not just …”. With those three words, I can usually already tell what’s coming before they tell me their idea, not because the suggestion is crazy complex but because almost invariably it’s the first thing that popped into the person’s head, because it’s the most obvious thing one could do, and has already been carefully considered or already tried. The question itself isn’t bad, it’s the underlying assumptions that makes it irritating and/or insulting, the assumptions that 1) their idea is so easy, and 2) you didn’t think of this obvious & easy idea.
And when I’m on the other end of this asking someone else why they didn’t do it in some way that looks obvious to me, I try hard to avoid “why not just”. Sometimes I will ask “I assume you didn’t X for some reason?” But maybe the best is to ask why nicely without making any suggestions.
When the question comes because they were lacking context, this can sometimes be headed off at the pass by announcing why the most obvious things didn’t work before explaining what you did do, or by highlighting the confounding requirements or problematic inputs. If the question comes from already-committed code, the goal would be to have commit or MR code comments that prevent post-facto second-guessing. Sometimes it’s useful to accept the question without retort and just answer it directly, by explaining that their idea was tried and didn’t work, and what the reasons are, and ask if they’d like to share any other ideas, earnestly not sarcastically. :P
If the suggestion really was something I didn’t think of and seems like it might solve a problem, which might be rare but does happen to me on occasion, then I do like to tell them it’s a good idea and recruit them to help me implement it. In that case, pushing back on their assumptions or tone is tempting to me, but I will try to let it roll off and just take the feedback and be momentarily embarrassed.
Barring it being a joke, the first question is unhelpful and likely a jerk move. Everyone makes mistakes sometimes.
The second question seems like the type of feedback that would usually be fine. People's skills and knowledge don't always overlap. What is crazy complex for A may not be for B and what is crazy complex for B may not be for A! And that doesn't have to have anything do with A or B being smarter. A might not know SQL and B might not know pandas. But sometimes it really does make sense to move some code from SQL to pandas or vice-versa (assume for the moment that both SQL and pandas are already in the tech stack). Some people find it simple to write in object oriented style and others in a functional style. What makes more sense to do is not always obvious. So the question could be a good one. If the suggestion is bad, explain why it's bad. If the suggestion is good, maybe consider if it's worth doing at current point. If it's somewhere in the middle or there's no time, acknowledge and move on.
An alternative is to plainly agree with them: "I know, that was dumb, wasn't it?" or "You're right, I probably shouldn't"or just "I'll think about it"
This means they can't shame / guilt you for doing something suboptimal and I believe this is often their goal - establish superiority by inducing guilt or shame.
It's like opting to not play the game with them. And usually, that's the winning move.
That seems really combative to me, like you're just escalating the situation. I hope I phrase it better than that (but you're presumably paraphrasing so it's a hard thing to self-assess), but I point out mistakes and suggest (what I think is) a better alternative all the time in code review, that's the point of it? If you replied to me like that I'd probably just disengage, not bother to look at your PRs any more.
I've taken to responding with: "Because you probably have more IQ points than me. I have fewer IQ points than you, so therefore I must do dumber and simpler things than you."
It's made some of their faces turn red in embarrassment, as they finally realized what unreflected belittling little dorks they were being.