18

Recently I dup-closed this question (with this question) using the new Gold powers. The close vote was subsequently revoked by another user, saying that it is not the duplicate of the closed question. The question however is very similar to the closed one and the answer of the duplicate question is applicable to the current question as well.

I understand that the original post by Tim Post suggests that:

Remember: duplicates are questions that ask for a solution to fundamentally identical problems - many questions have similar or identical answers but are not duplicates. By the same token, many questions are asked using very different wordings but seek to solve identical questions - closing these helps folks find their way to a solution even when they don't know what terms to search for.

Now my question is, should a question be closed only if it is an exact duplicate of another question?

Thanks Ffisegydd, for helping me phrase the question properly :-)

7
  • Can we not see the post history when it is closed by a gold badge? Commented May 13, 2014 at 15:16
  • @JeroenVannevel Here is the revision history .. and the timeline Commented May 13, 2014 at 15:16
  • 2
    @JeroenVannevel if I'm not mistaken, that's not limited to the dup-hammer closures. The revision link won't appear until there is at least 1 edit revision, regardless of whether or not the post has other activity. Show link to revision history when there are revisions but no edits is an existing feature reques to change that behavior. If there are no edits, then you have to hack the URL to see the history. Commented May 13, 2014 at 15:22
  • And... now it's closed as a duplicate of a much more recent question than the canonical close target (which I've closed as well--it should have been caught last week when it was asked.)
    – Wooble
    Commented May 13, 2014 at 16:50
  • 2
    The only time it's an "exact duplicate" is when the guy's been double-posting. In general I regard it as a "duplicate" when the symptoms are quite similar and the solution (or at least the key to arriving at a solution) is essentially the same. Eg, virtually all iOS "Unrecognized selector" questions are duplicates, even though the specific class and selector names vary from one to the next.
    – Hot Licks
    Commented May 13, 2014 at 17:05
  • 1
    Clearly I was incorrect in revoking your closing of that question; my apologies.
    – arshajii
    Commented May 13, 2014 at 21:13
  • @arshajii Oh you don't have to :-) We both did what we did, for the betterment of SO. Commented May 14, 2014 at 3:41

4 Answers 4

10

There are times when two identical answers apply to fundamentally different questions. The best example I can think of would pertain to compilers, and the hundreds of options that one can pass to them.

I could, conceivably tell someone that -Wall doesn't mean all warnings and that they should be using -Wextra during debug builds to catch something. That could be my answer to someone asking about type-punned pointers, and someone asking about if compilers can catch statements that should probably be conditionals, or at least a major part of my answer.

The questions, however, could not be further from identical. They're not asking the same question even though the same answer essentially applies to both. That's not to say that similarity of answers when you're not certain can't be a guiding factor - it often is, especially if the question you're considering closing is vague, incomplete, or otherwise not asked very well.

It's hard to give a definite formula on how to spot exact or near duplicates, because context is king and varies wildly. You might have the same question but completely different constraints - platform, endianness .. it's varied. Two identical sorting questions become vastly different when you add different time/space complexity constraints. That leads me to the best advice I can possibly give, and the advice I followed for over two years serving as your moderator:

When in doubt, don't.

There are plenty of clear cases, where there's just no possibility of additional complexity creeping in. "Headers already sent by [PHP]" is a classic case of this. "Can't free const variable [C]" is another. When the only thing different is the code demonstrating the problem, and all platform/version/endian/complexity constraints be damned, it's still a duplicate, then mark it as such.

Just read both questions very carefully, look for something in the target that isn't in the source (and the reverse of that) and use your best judgement. If you're not sure, just move on - let someone else make the call.

Over the course of the next few weeks we're going to be making even more drastic improvements to how duplicates are handled. From creature comforts to guard rails designed to protect corner cases better - it will be a much saner process, for everyone. There's nothing wrong with leaving something that you're pretty sure is a dupe, we'll catch it soon enough if it is.

1
23

Both posts are trying to solve the same problem. They used a different wording to explain their problem, but the problem itself was the same.

That's a duplicate.

14
  • 2
    Can't say I agree. One is asking about blah == x or y or z, the other is asking about x or y or z == blah. There could have been different answers to those two questions, it just so happens that in this case there were not. Consequently, I would not call those two questions duplicates.
    – arshajii
    Commented May 13, 2014 at 15:32
  • 1
    @arshajii, I really can't see what you mean. I don't see the difference between "blah == x or y or z" and "x or y or z == blah" but perhaps I'm missing something on that one, but I certainly don't see the difference in the questions, and I can't see how an answer would apply to one but not the other.
    – OGHaza
    Commented May 13, 2014 at 15:41
  • 6
    @arshajii Equality (and OR) are symmetric operations. There is nothing different about asking how to find A == B then B == A. It's the same problem. If the question was asking about some asymmetric operations and the reversal actually changed the problem then those theoretical questions wouldn't be duplicates. But so long as they are, the questions are duplicates.
    – Servy
    Commented May 13, 2014 at 15:45
  • @OGHaza Well I seem to be in a minority here, so perhaps I'm mistaken. My point is this: one questions is asking if a variable equates to one of many constant values, the other asks if one of many constant values equate to a variable. These two questions seem to me to be logically inequivalent, albeit similar. As I mentioned, it just so happens that they have the same answer in this case.
    – arshajii
    Commented May 13, 2014 at 15:45
  • 3
    @arshajii But they are equivalent questions. None of the differences are in any way germaine to the answer. If you assume that irrelevant differences in the question mean that the questions aren't duplicates then essentially you're saying that you never, ever, ever close questions as duplicates, because there will always be some irrelevant difference in the questions that isn't germane to the answers.
    – Servy
    Commented May 13, 2014 at 15:57
  • 3
    @arshajii Understanding the python idiom is the question. Which side of the expression your variables happen to be bound to - if 1 in (x,y,z) or if x in (1,2,3) - is not relevant to understanding the idiom.
    – roippi
    Commented May 13, 2014 at 16:02
  • @roippi Very well, I guess I was mistaken. Sorry for the confusion.
    – arshajii
    Commented May 13, 2014 at 16:25
  • 4
    @arshajii hey, you had an opinion and stuck up for it, no hard feelings.
    – roippi
    Commented May 13, 2014 at 16:29
  • @Servy: well, to be pydantic(*), neither of those is symmetric. But in this specific case, it doesn't matter. (*) pun intended.
    – Wooble
    Commented May 13, 2014 at 16:53
  • Should the "close as duplicate"-vote really denote an equality of the questions, or is it enough if the target encompasses the source? Because AFAICT the second interpretation makes more sense and is currently used, because it concentrates all relevant info in fewer good questions with much higher-quality answers. Example: "How can I overload == in C++?" "How does operator overloading work in C++?" Commented May 13, 2014 at 17:05
  • @Deduplicator That distinction is why it's just a "duplicate" question an not an "exact duplicate" question.
    – Servy
    Commented May 13, 2014 at 17:07
  • @Servy: Sorry if I wasn't clear enough. The point was not that the question have some unimportant differences, but that one of the questions is much broader, while in your answer you said "the same problem". Overloading == is not the same problem as general overloading of all operators, though definitely part of it. Commented May 13, 2014 at 17:14
  • @Deduplicator I don't see that applying to this case. The question wasn't closed as a duplicate of a more general question. It was closed as a duplicate of the same question. I don't have a problem with closing a question as a duplicate of a more general question, so long as applying it isn't likely to be a problem, but that doesn't appear to be relevant to this specific case.
    – Servy
    Commented May 13, 2014 at 17:22
  • @Servy I still have some doubts. Kindly see my answer.
    – arshajii
    Commented May 13, 2014 at 22:48
5

I have had people argue with me about my duplicate votes, commenting "This question is about splitting strings on spaces, the one you linked is about splitting on comma".

The duplicate close vote is a possible duplicate. I often edit the comment to make it a question, and retract the close vote if OP can state why they think their question is different.

More often than not, a question I link as duplicate is very much related, and can help OP solve their problem. There are thousands of ways to state any problem. That the questions don't match word by word doesn't mean OP can't be helped with the answers given in the linked question.

-3

Looking back, I don't think I necessarily should have revoked the closure of that question, and have already apologized in the comments to @thefourtheye for doing so. However, let me just take a minute to explain my reasoning, and I would appreciate any feedback.

The way I see it is this: firstly, questions with the same answer are not necessarily duplicates, I think we can all agree about that. In this specific case, one question (Q1) asks how to check if a variable equals one of many constant values, and the other question (Q2) asks how to check if one of many constant values equals a variable. The language is Python, but I don't believe that should have any bearing on whether Q1 and Q2 are duplicates, so let's put the Python factor aside for now. My original conviction was that Q1 and Q2 could potentially have different answers, and consequently that they were not duplicates. More specifically, answers to Q1 are not necessarily interchangeable with answers to Q2 and vice versa.

For example, many programming languages (such as Java) allow switch with fall-thru, which could have been a perfectly reasonable answer to Q2:

Q: How can I check if x is 1, 2 or 3?

A: Use a switch:

switch (x) {
    case 1:
    case 2:
    case 3:
        ...
}

This cannot be applied to Q1, however:

Q: How can I check if x, y or z is 1?

A: Use a switch:

switch (1) {   // Incorrect -- this is invalid
    case x:
    case y:
    case z:
        ...
}

Hence, this answer to one is not an answer to the other. Someone coming from a Java/C/C++ background who saw Q2 might not necessarily have an answer to Q1. Now, Python does not have a switch statement (again, I'm using switch as an example), but so what? There could still be other classes of answers that apply to Q1 but not to Q2 -- the Python factor is irrelevant when it comes to determining if Q1 is logically identical to Q2. I contend, therefore, that checking if x, y or z equals 1 can be fundamentally different than checking if x equals 1, 2 or 3 (the constants are of course arbitrary) from a programming standpoint. Hence, Q1 and Q2 are not the same question, but just happen to have the same answer in this particular case because we just happen to be dealing with Python.

6
  • That second piece of code is perfectly valid. What makes you think it's incorrect?
    – slebetman
    Commented May 14, 2014 at 7:09
  • @slebetman switch case labels must be compile-time constants (at least in Java/C/C++).
    – arshajii
    Commented May 14, 2014 at 11:16
  • But the question is not about C or C++ or Java, it is about python and afaict the question is so similar that the solution matches. Yes, there may be questions where this is not the case, and then (and only then) it is not a duplicate. When judging "is it asking the same thing" there are multiple ways that lead to a solution. "it has the same answer" is a prerequisite for being a duplicate, but not sufficient on its own. From another pov, "it has a different answer" is on its own is sufficient for not being a duplicate, no matter how similar the question seems.
    – PlasmaHH
    Commented May 14, 2014 at 11:38
  • @PlasmaHH Yes, the questions are absolutely so similar that the solutions match, but I am not convinced that they are the same question. I used the switch example to demonstrate that the two questions are not the same from a programmatic standpoint (i.e. their solutions are not necessarily interchangeable). What if tomorrow a switch statement is added to Python that works in the same way as described above? Would that automatically make the questions non-duplicates (assuming for the sake of argument that they are currently duplicates)?
    – arshajii
    Commented May 14, 2014 at 14:46
  • 1
    @arshajii: Yes it would. Just as the answer to the question "what does the auto keyword in C++ do" changed in 2011. There is always a little bit difference in each questions, so with your arguing, there would never be a duplicate. When left/right on the = sign doesn't matter, its the same question. Otherwise you would need to say that "x is 1, 2 or 3" is a different question than "x is 4, 5 or 6" or than "x is 1, 2, 6 or 3" since tomorrow a feature gets added to python that makes them different. [to be continued]
    – PlasmaHH
    Commented May 14, 2014 at 14:52
  • 1
    @arshajii: [cntd] Closing as dup really doesn't mean "this is the exact same question with the exact same details and circumstances" but it really does mean "This is so similar to the question this is marked a duplicate of that the OP should have found that question, realized that this is exactly what he is doing and tried the answer instead". If after then he would have realized "oh, this answer doesn't work" he would have posted that in his question.
    – PlasmaHH
    Commented May 14, 2014 at 14:53

You must log in to answer this question.

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