16

There are quite a few questions where the answer is the same as the answer to another (generally far more generic) question. A common example is a Java question where the OP is reporting some malfunction in his code. The root cause ends up being an incorrect String equality comparision, i.e. if (str == "value").

I know that it's frowned upon to answer duplicate questions, but the matter is that the OP probably didn't know it was a duplicate when he posted.

Indeed, the reference question for this issue (How do I compare strings in Java?) has a title which is precise and correct, but actually so precise that I would guess it's difficult to find unless you already understood the problem!.

(As an aside, I understand that if you actually debugged your code line-by-line you would find the issue, or at least something that "should work, but doesn't" leading to finding the proper question -- but then again, that probably applies for most, if not nearly all, questions on this site).

So, what would be a good course of action?

  1. Answering the question, explaining the error (adding a link to the reference question).
  2. Commenting, explaining the error (adding a link to the reference question).
  3. Marking it as duplicate with no further comment.
  4. Wait a prudent time for the OP to acknowledge the answer, then mark as duplicate.
  5. Any combination of the above?
3
  • 3
    Unless I have something extra to add in an answer which the reference question doesn't address (i.e something specific to the OP's code) then I would close as a dupe. Commenting would depend on the situation. The close reason is pretty clear but if I feel further commenting is needed then I do so. Just because the OP didn't know it was a dupe doesn't make it any less so. They will know now.
    – codeMagic
    Commented Jun 8, 2014 at 5:18
  • 2
    It doesn't matter that an asker wouldn't have been able to find the master question; if they knew how to find the answer, they wouldn't have asked the question at all. There's no significant difference between "The answer to your problem appears below your post" and "The answer is at the other end of this link on the same website". There are two goals: 1) get this person a solution to their problem 2) maintain a high-quality, easily-searchable archive for future readers. Closing as duplicate fulfills both those goals; answers spread across multiple questions hinders the second.
    – jscs
    Commented Jun 8, 2014 at 8:12
  • I think some basic debugging effort MUST be required from everyone who asks questions here. They should at least find out that if (str == "value") is what does not work as they expected. If they do not do that, they should not expect hand-holding. Simply close as a dupe.
    – kapa
    Commented Jun 8, 2014 at 11:14

3 Answers 3

7

In your example, just mark it as duplicate and move on. It is obvious in hindsight, so any comment is superfluous.

If it needs a fairly involved explanation to understand that it is indeed a duplicate, then are you sure that's the target you want for closing? Go with just marking as duplicate for a better fitting Q&A or (if none available) add an answer with references to relevant other questions so we have such a Q&A for next time.

If it is borderline, comment and dup-close might be appropriate: Your judgement on the specific situation is needed.

1

I would suggest option 2). Answers to duplicate questions should only be made where additional explanation of the problem needs to be extensive or if the question has sufficiently different aspects that a longer answer is needed to show how it relates to the original.

0

In this 2009 blog article, Jeff Atwood wrote :

As I see it, there are three classes of duplicate questions, from most clear to least clear.

  1. Cut-and-paste duplicate questions. These questions are the very definition of exact duplicates; [...]

  2. Accidental duplicates. These questions aren't copy and paste, but they cover the exact same ground as an earlier Stack Overflow question. The overlap is not ambiguous; [...]

  3. Borderline duplicates. These questions are ambiguous; they're in the same ballpark as a previous question, but have subtle differences that may make them legitimately standalone questions. These are subject to interpretation. We rely on Stack Overflow users to tag these questions appropriately so they naturally "group" with the questions they're related to. [...] There's often benefit to having multiple subtle variants of a question around, as people tend to ask and search using completely different words, and the better our coverage, the better odds our fellow programmers can find the answer they're looking for.

I believe the use case you're talking about qualifies as borderline duplicate questions. For more details on what's the proper way to deal with borderline duplicates, see Answering “borderline duplicate” questions.

You must log in to answer this question.

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