This is the right way to answer these questions. SO was famous for the infuriating "You shouldn't do X, so as a favor to you I'm not going to tell you how." or "Before I answer thee, thou must first answer me these questions three!" kinds of answers.
Ultimately, it should be on me to choose whether I want to risk doing X or whether I want to take up your offer to explain Y, not the "as a favor to you, I'm not going to tell you how" way you described.
paultopia•49m ago
dgellow•36m ago
javawizard•1m ago
Back when I worked at Google there was an internal page someone put up that denoted what they called "the YX problem": that the XY problem, applied to a sufficiently great extent, creates an environment where more productivity is lost convincing one's interlocutor that X is in fact the correct problem to solve than would be lost by chasing X and having to later pivot to Y if that turned out to be wrong.
It's extraordinarily aggravating when it happens. I really wish it was something we talked about more.