18

I have recently asked a question where an answerer kindly gives me a working solution, though not as automated as I wanted.

Seeing that the answerer seems to have better knowledge than me - but at the same time realizing that his solution seems to lack "automation", I further ask him in the comment if he knows of any more "automated" solution than what he originally posted. He sincerely said that he is not aware of any. And thus, I accepted his answer as it is working nevertheless.

A day later, another person comes to see my question and suggested me to look at a post which may contain a better - more "automated" - answer to my problem. I opened the link, and there it is! I found what I am looking for!

(Note: The title of the post is quite different than mine. Thus, I did not expect that the solution I wanted can be there)

And so I thank him and upvote his answer - thinking that it should be the answer for my question. However, now, I am wondering if I should somehow make a redirection somewhere in my post to his answer - for the sake of those who may have the same question.

Should I do that, say, in my question?

Normally this is done by marking it as a duplicate of the later question, but the two questions here are actually quite different though the solutions are not that different.

What is the correct thing to do in this situation?

1 Answer 1

33

You basically have two options:

  1. Mark your question as a duplicate of the question containing Gert's answer that you like. However, you should only choose this strategy if your question is actually a duplicate. If that other question is about something completely different, and only coincidentally has an answer that solves your problem, your question is not a duplicate and should not be marked as one.

  2. Take the essential bits from Gert's answer, remix as appropriate to create a fully-working solution that directly answers your question, and post your own answer to your question. It is perfectly valid to answer your own question—just be sure to give attribution to Gert for his original answer. A full name and a link would suffice.

If you go the second route, it is up to you whether you change the accepted answer to your own, or keep Steve's answer as the accepted answer. If you think your answer is really the best solution, then you should consider accepting it. Steve's answer will still be there, too, and you've already upvoted it, so he is still getting credit for the effort he put in to write it.

Whatever you do, do not add an answer to the body of your question. Questions and answers are kept completely separate on this site.

Independently of any of the above, if you really wish to thank someone for one of their contributions, you can always offer a bounty.

11
  • I disagree with your rules for duplicates. If the other question has an answer that solves your question (ideally the accepted one) mark it as duplicate. Commented Feb 17, 2016 at 18:20
  • 34
    @Yakk I disagree with your disagreement. Commented Feb 17, 2016 at 18:28
  • 1
    @Yakk: note: the question and the actual problem may be different. The answer that provides solution to the problem may be unrelated to the question. Whether or not to close as duplicate in a similar situation depends on specific questions in each case.
    – jfs
    Commented Feb 17, 2016 at 20:20
  • 6
    I think the line is between "coincidentally solves the problem" vs "comprehensively answers your question". If the answer does answer your question, perhaps in explanatory background information, then closing as duplicate is best even if the two questions didn't ask the same.
    – Ben Voigt
    Commented Feb 17, 2016 at 20:37
  • 3
    For example, an answer to "What is a linked list?" might explain that random access is impossible and therefore access to the nth element has linear complexity. Then a new question "Why is my binary search algorithm very slow on linked lists?" could be closed as a duplicate. On the other hand, an answer recommending vectors might solve the problem, but it doesn't answer the question at all.
    – Ben Voigt
    Commented Feb 17, 2016 at 20:42
  • 1
    @BenVoigt: Most visitors on SO are from google. if I came from google; I don't care what OPs problem was. It should be taken into account while deciding whether a question is a duplicate of another.
    – jfs
    Commented Feb 18, 2016 at 4:29
  • 2
    Agreed, @Ben. I never really know how to phrase this. It is a distinction that is quite obvious to me in practice, but seems to be the object of frequent quibbles on Meta. If the questions cover overlapping ground and therefore have identical solutions, they are duplicates. The precise wording of the questions is not at issue. If the questions only coincidentally have overlapping answers, then they are not duplicates.
    – Cody Gray Mod
    Commented Feb 18, 2016 at 10:30
  • @J.F.Sebastian well, if your problem wasn't the same as OP's how do you expect to find the solution in first place?
    – Braiam
    Commented Feb 18, 2016 at 13:15
  • @Braiam: reread my comments. The premise is that the actual problem may be different from the explicit question (otherwise the question should be closed as duplicate) e.g., the question: "how to convert JavaScript timestamp to Python" while the actual problem: Date(ts) and new Date(ts) are different in JavaScript (the former ignores ts). Google provides the link to the question based on its text, not the problem in OP's head.
    – jfs
    Commented Feb 18, 2016 at 13:29
  • Wouldn't editing the accepted answer to include the additional 'automation' be a reasonable option? Commented Feb 19, 2016 at 0:14
  • @hatchet Yes, in certain cases, that would be a reasonable choice. But you have to make a judgment call about whether the information you're adding is actually an addition to the original answer, or whether it is different enough that it merits its own answer. Think of the people who will come across the question in the future. Which will be more clear?
    – Cody Gray Mod
    Commented Feb 19, 2016 at 8:30

You must log in to answer this question.

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