-12

As has been discussed before and answered, more than once, duplicate answers may suggest, but do not prove, that questions are duplicates.

That said, please consider this question: Determine if string is in list in JavaScript.

After almost seven years of being a good stand-alone question, it was closed today as being a duplicate. However, in my opinion it is not a duplicate even if the answer is similar, because the intent of the question is different. I'll quote from the notes I added to the end of the question (which was summarily deleted by someone--any thoughts on that?):

This question is not a duplicate of how do I check if an array includes an object [item] in JavaScript. The question here is "how to determine if a string is in a list" and the answer is "check if an array includes the item". The fact that how to perform that task is provided here as a convenience does not make the question a duplicate.

Imagine if this were a home improvement Q&A site. Someone asks, "how do I remove smoke smell from a room?" The selected answer is "paint the room" with a simple step-by-step guide on how to paint rooms. Would you close "how do I remove smoke smell" as a duplicate of "how do I paint a room"? No, you wouldn't unless you were not thinking clearly. The answers contain overlap, but duplicate answers aren't duplicate questions!

I see this as a potential reverse of the A-B problem. Sometimes, askers say "How can I do A" when in fact they want to do B, and they incorrectly restrict the possible range of answers by suggesting A instead of asking the more general question. (Along the lines of, "how do I use a drill" instead of "how do I make a hole"?) Most seem to agree this is an error by the questioner.

In this case, I asked for the more general "B", and the answer in this case was to perform specific implementation "A". (Along the lines of, "How do I make a hole?" and the answer being "use a drill.") But notice, asking for how to do B is not actually the same thing as asking how to do A, and people have gotten confused about that in closing the question as a duplicate. They seem to be committing a "B-A" error similar to the above "A-B" error.

Look at it this way. For all we know, there will be a future native means in JavaScript to check for whether an item is within a list of items. Someone will come along and answer my question with that technique, essentially "Use C!" Now the question is "How do I do B", and the answer will be "Do C.", and this is a duplicate question for "How do I do A"? No, it's not the same question, as the answer could be different, and it is only coincidentally the same as "A" at this time.

In fact, had I simply preferred a different answer than the one I did, such as deciding that a list of OR expressions was better, that alone would have made it very obviously different. But how can changing what I think is the subjectively correctly answer affect whether the question is a duplicate!?!?!

To round out the discussion by extending the examples above, some day we could answer the smoke smell question "Rent a Smoke-B-Gone from your local hardware store." (That obviously makes it a different question; how can a different answer change the fundamental nature of a question?) And similarly, some day a new wood disintegrator could be created, thus the answer to "how do I make a hole" can be "use a wood-disintegrator" which shows that it's not the same question as a "how do I use a drill"?

10
  • Wow. As a long-time user and contributor of SO I'm shocked by the response.
    – ErikE
    Commented Jan 6, 2017 at 21:47
  • 10
    The point of marking duplicates is to get people to the best answers. So if the answers on the duplicate also answer your question, it's a duplicate.
    – jonrsharpe
    Commented Jan 6, 2017 at 21:57
  • 2
    I agree that if questions happen to have the same answers but they are substantially different, they should not be marked as duplicates (but I don't know the SO ruling on this). However, both of the referenced questions are just How to find X in a list, of which object is more generic. Your rationale that it could change in the future is not persuasive IMO, it could be used on any duplicate.
    – code11
    Commented Jan 6, 2017 at 21:58
  • 3
    @ErikE: "I'm shocked by the response" You clearly have not contributed much on MSO, because downvoting posts we don't agree with is standard procedure here. Commented Jan 6, 2017 at 21:59
  • @code11 Because an array is not a list? My use of "list" just means, a mental collection of items. An array is a particular data structure, which is only one possible means of enumerating a list in JavaScript (for example, a switch statement introduces a list).
    – ErikE
    Commented Jan 6, 2017 at 22:00
  • 1
    @jonrsharpe That doesn't make sense. The entire point of my disagreement is that the answer is only coincidentally the same, and could change in the future. How does that make it a duplicate?
    – ErikE
    Commented Jan 6, 2017 at 22:01
  • It's not clear to me what distinction you're trying to draw. Perhaps if some magical future JS comes along that means they're totally different answers it could be reopened then?
    – jonrsharpe
    Commented Jan 6, 2017 at 22:06
  • @jonrsharpe So if I had selected a different answer because I liked it better, the question wouldn't be a duplicate?
    – ErikE
    Commented Jan 6, 2017 at 22:08
  • 7
    Having read through both questions and the A-B argument. I have to agree with @ErikE. the duplicate flag is should only be used on duplicate questions. In this case it may be possible to have a solution that determines if a string is in an array that is more efficient/elegant than that of a more general solution to find an object in an array. The fact that the general answer satisfies both does not make the questions the same.
    – piRSquared
    Commented Jan 6, 2017 at 22:26
  • @piRSquared Even more, the list of strings doesn't have to be in an array at all. The question was how to test in an expression, along the lines of the SQL Column IN (ColumnA, ColumnB, ColumnC), where the list of items is explicitly denoted and doesn't have to be in a special data structure.
    – ErikE
    Commented Jan 7, 2017 at 3:04

2 Answers 2

11

Look at it this way. For all we know, there will be a future native means in JavaScript to check for whether an item is within a list of items. Someone will come along and answer my question with that technique, essentially "Use C!" Now the question is "How do I do B", and the answer will be "Do C.", and this is a duplicate question for "How do I do A"? No, it's not the same question, as the answer could be different, and it is only coincidentally the same as "A" at this time.

At some point in the future, things may have changed such that an answer to your question would be different from an answer to the other question. But until that point actually arrives... what should we do? You would have us repeat answers, scattering them around various questions.

All for a future that might never come.

I say de-duplicate them when that future actually comes. Or ask a new question with an appropriate and different answer. I do not see a mere possibility as being a legitimate reason to not mark a question as a duplicate.

2
  • 1
    I appreciate your argument here, though you're still focusing on the "questions are duplicate because currently-selected best answers are the same". I think question duplication should be about questions, not answers.
    – ErikE
    Commented Jan 6, 2017 at 23:12
  • The SO question was reopened as not a duplicate on the day that I originally asked this meta question. In any case, it has a new selected answer that is not a duplicate of the question it was originally marked a duplicate of. So the future actually came.
    – ErikE
    Commented Jan 9, 2017 at 16:05
-1

The fact that two questions have the same answers is a sign that they might be dupes. In many cases, it will be a strong sign, possibly the strongest. What that doesn't mean is that we can then say that the definition of a duplicate question is one that is answered the same. @ErikE is right by saying that "question duplication should be about questions, not answers."

If "has the same answers" is really the definition of a duplicate question, then the question "Are strings mutable in Java?" would be a dupe of "Is dereferencing a null pointer defined behavior in C?" and also a dupe of "Can you mark code blocks with curly braces in Visual Basic.NET like you can in C#?" The answer to all three questions is the same - it is "NO".

This even applies to a more complex answer. Suppose someone asked the question "Why do I get random behavior when I dereference a null pointer in C?" and another person asked the question "When I declare an "int x;" in C, don't set it to anything, and then try to output it, why do I get garbage?" both questions could be answered "That is undefined behavior in C, see the standard." They aren't duplicate questions. A quick search on the main site reveals that we have several questions on different allegedly undefined behaviors in C that are not closed as duplicates.

4
  • 6
    The straw horse you offer has already had all the stuffing beaten out of it despite being dead for a long long time. The answer to all those questions isn't the same on Stack Overflow, because "NO" doesn't even meet the minimum length requirement, let alone come up to a passable level of quality.
    – jscs
    Commented Jan 7, 2017 at 2:44
  • 1
    @JoshCaswell He wasn't suggesting that "NO" is a valid answer (so the argument you've seemingly knocked down was a straw man). He said that in order to make a logical point that duplicate answers do not automatically make duplicate questions (which he achieved).
    – ErikE
    Commented Jan 7, 2017 at 2:52
  • 1
    This seems like a long way of saying that the answers have to be the same and so does the language tag. Seems pretty obvious to me. And if you try and draw the conclusion out any more than that, you border on the horse abuse that Josh Caswell already pointed out. You're going to have a hard time convincing me that we really need separate questions on every possible thing in C that could cause UB. I'd mark them all duplicates of a "What is UB?" question in a heartbeat, and I'm not alone—many of our most valuable C contributors do the same.
    – Cody Gray Mod
    Commented Jan 7, 2017 at 12:17
  • 2
    The "logical point" that textual equality of answers requires a conclusion of duplication is not an argument that anyone actually makes. So it's irrelevant.
    – jscs
    Commented Jan 7, 2017 at 13:02

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