It would be fine to help with all these other possibilites but part of your answer should... actually answer the question that was asked, as it was asked and not doing so should result in a servere punishement.
It would be fine to help with all these other possibilites but part of your answer should... actually answer the question that was asked, as it was asked and not doing so should result in a servere punishement.
For me, questioning someone's question, asking more info, pointing out he/she might be doing the wrong thing, ... does not in any way involve me assuming knowing things better than the questioner or anyone. (e.g. for all I know, the asker is way more intelligent and wise and knowing than I am, but just temporarily confused - happens to me sometimes so can happen to others) Those two are orthogonal for me, it's just my nature to always question stuff. Including myself. And this certainly helps in finding solutions. And doesn't lead to me thinking I'm better. Perhaps different sometimes, yes.
your answer should... actually answer the question that was asked, as it was asked and not doing so should result in a servere punishement.
To stick with the enalogy: while the answer 'buy lamp, take ladder, unscrew old, screw in new' might perfectly answer the question, it is in my view completely useless if it doesn't solve the problem. So I'd leave a comment asking for more info. And if someone else would already have given that answer I'll probably leave a comment saying it's rather incomplete. Because it's imo the only way to actually help the OP. Why on earth should one get punished for that? Isn't it the right thing to do?
Well, this is exactly the problem I'm describing: you're trying to solve the problem for one user when the answer is for everyone who could ever ask something similar enough to come to the page from a search engine. So ignoring the question and solving the problem might help the OP but it doesn't help anyone else who actually needed to know how to replace a lamp. In fact it's hurt them because now "how to move a lamp" is considered solved by a lot of people but the actual page with the "solution" does not contain one.
But SO is a QA site - you are only supposed to answer if you indeed know better than the person asking!
I acknowledge there is a grey area with the so called XY question, where the questioner ask about one thing but actually want to achieve something different. But in such cases the correct approach is, in my opinion, to help the OP solve the actual problem they have, not lead them down the wrong path.
https://jdebp.eu/FGA/put-down-the-chocolate-covered-banana.h...
there is also the issue about the (missing) Standard Litany:
https://jdebp.eu/FGA/problem-report-standard-litany.html
particularly on a technical resource such as StackOverflow, lack of specifics are a problem (as they often don't allow for correct/effective answers), and in theory the OP asking should well know, being a technical person, the importance of providing background information when asking a question.
For example, let's say the title of the question is, "How do I reformat my hard drive on linux?" and the body of the question is "I accidentally screwed up my upgrade of Ubuntu by <doing XYZ> and now it won't boot. Can I reformat the hard drive and install again so I can boot?" If your answer is "Are you sure you need to reformat? Have you tried <solution to XYZ>?" then you may be solving OP's root problem but you will be making a useless landing page for anyone searching "How do I reformat a hard drive on linux?"
I don't think it is helpful to answer the literal question rather than the actual problem, since this is optimizing for a hypothetical future reader at the expense of the actual person having a problem. After all, the future reader might also have the same problem as the current user.
Which is fine because there are N potential future readers but only one OP.
You suggest answering "the wrong question" would help more users in the future. I don't see why that would be likely.
N could be less than 1
If you're worried about it then just answer exactly what was ask and follow your strategy. But please don't simply do your strategy because it's a real pain for those of us who end up having to move off the beaten path from time to time.
My point is just you should try help the person at hand with their actual problem, the X, and then clarify the question title to reflect the problem they need help with. It is easy to see if an answer have solved the actual problem - the OP selects the answer as "accepted".
If another person have a different problem which happen to be Y they will ask that as a question and get help for that. Everybody is happy.
I get really miffed when I see someone answering the literal question even when it is clear that the OP have a different problem and is just not knowledgeable enough to put it in the technically correct terms. I guess it is an effect of the education system when people think it is better to provide a useless but technically correct answer, than actually help people who have a problem.
Answering both X and Y is fine of course, and probably the preferred.
How many times have you seen that happen? Further that only occurs in an XY situation where the question was wrong. I've been hit by cases where the answer was "don't do that because it's bad". Well, I know that and I know why it's bad but I also know that I have to do it anyway. What now? You couldn't change the question in that case because they asked what they meant, they were just told that they were wrong (and they were).
>I get really miffed when I see someone answering the literal question even when it is clear that the OP have a different problem
And I get just as miffed when they don't because of all the times I get burned by people behaving as you want and then I can't get that same answer answered and have to go through even more pain (it was painful enough to be forced into the situation) to figure it out for myself. I have basically no karma on SO because when I get some I use it to vote down such people.
>Answering both X and Y is fine of course, and probably the preferred.
Here we can agree.
It is the OP which decides what it the accepted answer though, but the community should not upvote unhelpful answers.
Or the best answer follows the "here's how to do what you asked, HOWEVER: <detailed description of actual problem and solutions>"
And if the question is 10 years old the day I need to reformat my linux hard drive? The OP might not even still be alive. Certainly there will be resistance to rezzing a 10 year old thread to make the question more general.
If the question is "why do I get a segfault?" and we find out he's trying to write C code to title-case a string in-place, and he's passed in a string literal, we can edit the question to "Why do I get a segfault trying to modify a string literal?" or similar.
If the objection is that answering the real question will confuse people, then make the question match the correct answer.