We get a fair number of questions here that are something like this:
How to do X
While trying to create/do Y I tried doing X and couldn't figure out how to do it. I tried various ways of doing X and nothing worked. How can I do X?
Even though the question is how to do X, I often see answers on another way to do Y that doesn't have anything to do with X at all. These answers are often upvoted, and not infrequently even accepted.
I have mixed feelings about such answers.
- On one hand, the OP's original problem is fixed and end goal achieved. The OP is happy and the answer may even help some future potential visitors with similar situations and trains of thought as the OP.
- But on the other hand, such an answer doesn't really answer the question at all, it just addresses some backstory/context specific to the OP. After all, if I was looking for how to do X in my own situation, I would probably want an answer on how to actually do X, not Y. And if I wanted to do Y, I would be searching for how to do Y, not X.
Personally, I tend to lean towards the latter viewpoint (though thinking back I have posted a few answers like this myself), but I don't really have any idea what do do with such answers either.
So do we have any guidelines on what our policy is with regards to answers giving different ways of going about the OP's situation instead of answering the actual question? Are these answers OK, encouraged, or discouraged? What should be done with such answers?
Notes:
- I am talking about situations in which the question is clearly asking how to do X (and X isn't necessarily wrong at all). The OP just also mentions that in their overall project, they are trying to end up with Y, and then people post answers giving another way to do Y instead of answering how to do X.
- This question is highly related (and the top answers back up my point of view here), but I don't feel it is a duplicate since it is talking mainly about answers which suggest "better practice" as opposed to a specific end goal the OP actually mentioned.
- This question (currently marked as a duplicate) is really talking more about the questions themselves, and nothing there at all (that I found) addresses what to do with the answers. It also seems to be focused towards poorly-constructed questions, or questions where the OP is going about something the wrong way, neither of which is what I am talking about.