4

A while ago, I saw a question with a title that interested me, skimmed the question itself, and quickly posted an answer that seemed appropriate. Upon going back and re-reading the question, however, I realized that the OP wanted something quite different from what I provided.

My answer, however, does describe a very concise way to "subtract" two hashes in Ruby, which is exactly what the question title is asking for (though the question body itself defines "subtraction" quite differently than I do)--which I suspect is the reason it's gotten several upvotes and is now one vote short of being the top-voted answer despite being based on a misreading of the question. (Admittedly, it's not a particularly popular question; the top-rated answer only has 4 votes.) I've added a disclaimer to my answer pointing out that it doesn't actually answer the original question, but I suspect I'll continue to get a slow trickle of upvotes.

Is this situation problematic? My guess is that people are googling something like "ruby subtract hash", finding that question, and seeing my answer, which is exactly what StackOverflow was designed for--but the popularly "right" answer (mine) isn't actually the right answer to the question asked (nor, by the way, is the current top-rated answer). Should I ask a new question that is answered by my post and re-post the answer there? Should I edit the title of the original question to indicate that the OP is looking for subtraction of the values in the hash? Should I do anything at all beyond adding the disclaimer in my answer?

1
  • 1
    I would leave it alone. It's clearly useful to people who are searching for what is in the title of the question, and you've already done the work to post the answer. It isn't doing any harm. It probably shouldn't have been posted in the first place though.
    – Kevin B
    Commented Jul 3, 2014 at 15:48

1 Answer 1

6

The answer doesn't answer the question, so you should either edit it so that it does answer the question, or delete it.

The question apparently has a very misleading title, so you should edit the question so that it is clearer what it's actually asking for.

If you feel that your contribution is useful information then you should find an appropriate question to post it to, if you can find a question that is asking the question that you actually answered. If you can't find one (which seems unlikely in this case), then go ahead and ask that question yourself to create a place for you to post the answer.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .