Background
From my experience, both when asking my own questions and when finding past questions and answers, a major bane of SO is the infamous so-called "XY problem" - and not technically the XY problem itself, namely when people ask about the wrong thing, but more precisely a dual problem I don't know (if there's) a term for: when people accuse the OP of XY (sometimes consciously and explicitly, sometimes not) and answer something else.
In my experience, this is problematic in two ways:
- When searching for information on something I sometimes stumble upon questions very similar to my own. But often the answers (including accepted and highly positively voted answers) don't answer the question at all, but something else. This significantly hinders the process of searching for the information I need, and on top of it it hinders the process of asking new questions about it, because superficially these new questions appear to be duplicates and to already have been answered.
- When asking my own questions, I often get answers to other things (because those answering think they know better what my real problem is), which are far from satisfactory (because actually my real problem is exactly what I asked), and the discussions that arise are often unpleasant, and add a lot of noise.
My take
When answering
I think that for the benefit of the quality (ease of search/navigation/use) of the mountains of Q&As we're constantly generating for posterity, answers should always answer the question asked. When someone suspects a given question is an instance of the XY problem, the right way to deal with it is to comment about it (not answer!), and ideally refer to other places where what they think the real problem is is discussed, or if there aren't enough references then encourage the OP to open another question and ask about the other problem if that's what they actually need. And then they can answer there. (And if they really want to provide an answer right away, and there's really no other information around to refer to, they might even post what they think is the right question on their own, and answer it, and refer to it. The important thing is that the answer is posted on a matching question, not on a different question.)
When asking
Something I've seen others do which I like a lot, and I think is a good principle in life in general, is being explicit. If all users acted as suggested above when answering questions, this wouldn't be necessary, but as it's not the case (yet), I find it extremely helpful to state explicitly that I'm seeking answers to what I've asked and not "answers" which tell me that I actually need to do something else altogether, and that if someone does think that's the case, they're welcome to write it in comments.
It adds effort to posting a question (theoretically it also means the question has more text to read which is also some burden to anyone reading it afterwards, but it's only a couple of sentences), but I think it is worth it so long as users providing answers don't act according to the guidelines above.
Clarification: All this is my own opinion. I don't know if there's a consensus about it among experienced users, and if that consensus, if it exists at all, matches my take. And I don't know if there are any pertinent official guidelines and what they are.
Recent event
I recently posted a question, and, in accordance with what's explained above, I added an "anti-XY-accusation" note. Shortly after, another user edited my question and removed that note (https://stackoverflow.com/posts/65349747/revisions).
Questions
So what I'd like to ask/discuss is:
- Does the community agree with my impressions (as detailed under Background above)?
- Does the community agree with my approach (as detailed under My take above)?
- Does the community agree with the edit (mentioned under Recent event above)? If so, does the community think I should just do away with such notes in the future, or may (or even should) I include such notes but word them differently? (Part of the problem is that the reasoning behind the edit is not mentioned. I don't know if the editor thinks running into the issues above is desired, or if he thinks it doesn't happen often enough to justify such a note, or if he found my language too harsh, or what. Which brings about another issue: how to deal with edits in general. Comments with relevant references welcome!)