It seems there is some discussion going on at a particular question on SO regarding whether a new question is an exact duplicate of an older question. It seems that once a question reaches a certain critical mass of closing votes, that the piling on occurs (the new question has received 3 close votes as of 1445 EST on 20JUN11). Is this a duplicate or not?

New question: What restrictions does ISO C++03 place on structs defined at function scope?

Old question: Usage of local class in C++ function

  • See also meta.stackexchange.com/questions/95805/…
    – user102937
    Jun 20, 2011 at 20:13
  • 7
    Taking a trivial example - the answer to "what's two plus two" and "what's eight divided by two" is four. Does that make the questions duplicates? Just because the same answer applies to both questions it doesn't necessarily make them duplicates. It's an indication they might be.
    – ChrisF Mod
    Jun 20, 2011 at 22:08

2 Answers 2


Questions should only be closed as duplicates of each other when the question is a 95 to 99% duplicate of the original question. The answers have nothing to do with this determination.

A certain amount of natural question duplication is desirable; see this StackOverflow blog entry.

  • 4
    I don't buy this. Surely the point of closing as duplicate is to keep all the useful information in the answers in one spot to maximize its ability to be found? The duplicate questions serve as funnels to bring searches on various terms to the solution, and to bring future/improved answers to the same spot. Spreading eight variations of the same answer across the site makes the information much harder to find and use. Concentrated, comprehensive answer information is what makes SO/SE so valuable compared to a generic web search.
    – jscs
    Jun 20, 2011 at 19:47
  • 1
    @Josh: SO/SE is not designed to centralize information, it's designed to answer people's questions. If the questions are different they are different. Period. Perhaps another close reason needs to be added to handle this case, but calling things exact duplicates is rude to the question asker. Jun 20, 2011 at 19:55
  • @Billy: Not so. See: The Wikipedia of Long Tail Programming Questions, (now a Meta Question too!) particularly the bits about "Canonical Answers" and "Don’t answer questions that have already been answered elsewhere."
    – jscs
    Jun 20, 2011 at 20:01
  • 2
    @Josh: But you cannot ignore the "If you’re going to close a user’s question as a duplicate, it has to be a real duplicate." part -- that's just as important. What answerers do with a question is outside of the askers' control. Jun 20, 2011 at 20:03
  • @Josh: That's a great blog entry, and I agree with it's principles. But ours is an imperfect system. Even Wikipedia suffers from pedantic wars (where people endlessly debate trivial issues) on a regular basis. It's amusing to watch, but it's more like making sausage than it is like building a house.
    – user102937
    Jun 20, 2011 at 20:05
  • But when "No, you cannot do that because <same rule in the language standard>" is the correct answer to both questions, how are we going to know that they are different questions?
    – Bo Persson
    Jun 20, 2011 at 21:41
  • 5
    @Bo: Um... By reading the text of each question? You're still trying to detect duplicate questions by looking at the answers; you can't do that.
    – user102937
    Jun 20, 2011 at 21:55
  • 2
    @Robert - I did, and I read "Why does it hurt when I kick the wall with my left foot?" and "Why does it hurt when I hit the wall with my right hand?". There is >20% difference in the wording, is that enough?
    – Bo Persson
    Jun 20, 2011 at 22:06
  • 3
    @Bo: I think that's a straw man. To the uninitiated, the two questions being discussed appear prima facie to be two different questions. If you already know the answer to the two questions, and already know that they have the same answer, then why bother asking the questions in the first place?
    – user102937
    Jun 20, 2011 at 22:11
  • @RobertHarvey Is this still the rule of thumb? Because it does not seem like this is how dups are being handled. This is just one example Please explain why Java and C give different answers for this code the question is 50% about Java the dup is 100% about C. I have even seen C questions closed as dups of C++ questions and vice versa where the details of the answers can be very different. Aug 26, 2013 at 13:20
  • @ShafikYaghmour: It's still the rule of thumb. Canonical questions are sort of an exception. Some questions are asked all the time, in one form or another, so the community writes a comprehensive question to answer them. That's very different from finding some random answer on Stack Overflow that answers the OP's question, and then marking his question as a duplicate, even if the question bears little resemblance to the OP's. That said, the question you linked is not a duplicate; I have reopened it.
    – user102937
    Aug 26, 2013 at 15:51
  • @RobertHarvey That makes sense, this thread and When is a duplicate question not a duplicate?, are two of the better ones on dups but they don't seem to cover that aspect. Is there a thread I am missing because I searched a while on this topic. Aug 26, 2013 at 15:57
  • @ShafikYaghmour: Canonical questions are a bit of a rare breed. Only a tiny part of the community seems to know how to do them properly, and we don't have adequate documentation for canonical questions, except maybe this.
    – user102937
    Aug 26, 2013 at 16:11

Two questions are duplicate pretty much when they have the same answers.

  • Note that I wrote “the same answers”, not “the same answer”. You have to look at the answers as a whole. Just because there's one particular solution that works for two problems doesn't mean they are the same problem. But if every solution to either problem is also a solution to the other problem, then the problems are the same.
  • Note that an answer is not just the TL,DR version, it's the whole answer, including explanations. Just because you're using the same tool for two different tasks doesn't mean they're the same task. But if you're using the same tool in exactly the same way, then the tasks are to all intents and purposes identical.

For the two questions you cite, it looks to me (I'm not a C++ expert) like these are different questions, with different answers. Nawaz's answer based on a particular paragraph in the C++ standard is relevant to both, but it's not the whole story; for example Als's answer looks suitable for only one of the two questions.

Or to take another example from Kaestur Hakarl cited by Grace Note in a related thread:

I asked for an atomic UNIX operation on unix.se, and got the answer I was looking for - mkdir. It would be ridiculous if a question about how to create folders got closed as a duplicate of mine!

Here mkdir is one tool for the job in both cases, but it's not the only possible atomic operation, and the reason why mkdir is suitable (which is part of the answer) is different in both cases. So “what utility exposes an atomic operation” and “how to create directory” have a part of an answer in common, but they don't have the same answers, they're not the same questions.

  • 1
    Why not just examine the questions to determine duplication? Your two example questions could correctly be answered mkdir without any further explanation, and the questions would still be non-duplicates.
    – user102937
    Jun 21, 2011 at 1:44
  • 2
    @RobertHarvey lockfile is clearly not a correct answer for creating a directory, so the questions don't have the same answers. “mkdir” with no explanation is hardly a good answer for an atomic operation anyway. The problem with looking at questions only is to know what details are relevant. For example “how do I add two 1024-bit integers in Python?” is a duplicate of “how do I add two 16-bit numbers in Python?”, because Python's integers are automatically bignums. In C these would be very different questions. It's easy to tell from answers, less so from the questions. Jun 21, 2011 at 6:45
  • I will stipulate that your convoluted strategy might actually work. How will you motivate people to actually do it, and how would you sell it to management so that the close reason gets changed?
    – user102937
    Jun 21, 2011 at 16:32
  • 3
    @Robert What strategy? This is a definition for “duplicate question” (Leibniz equality). I don't want this close reason changed. As for motivating, less than 90% of closings are crud, so I guess it works. Jun 21, 2011 at 18:00
  • You're overcomplicating the issue. Nobody's going to take the time to review all answers in both questions and come up with the equivalent of a Levenshtein Distance. It's too much work.
    – user102937
    Jun 21, 2011 at 18:10

You must log in to answer this question.

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