25

From time to time, discussions arise about the merits of posting identical answers to (allegedly) related-but-not-duplicate questions. In almost all of these, someone brings up the same argument that there can be rather different questions that still have the same answer. Unfortunately, all the examples I've seen are trivial ("42", "blue", etc), and entirely lack the explanations that are at the core of SE.

So I have a challenge: present a question-question-answer tuple — whether on-topic on any current SE site or not, although they should otherwise generally meet standards — that satisfies these three requirements:

  • Questions are fundamentally different beyond reasonable doubt.

    In other words, they are not duplicates. This must of course be thoroughly demonstrated, since this is challenging the basic assumption directly.

  • The answer includes an explanation sufficient to teach anyone with generally similar problems how to address their problem as well.

    Pretty simple; an SE answer without explanation is fairly poor at best and on some sites will be deleted out of hand. There's no point in arguing for the existence of questions that can be kept open only by the promise of attracting terrible answers.

  • The answer needs only cosmetic adjustments, if any, to be suitable for both questions.

    That is, surface details like variable names, specific gadgets, or certain minor points of interpersonal conflict may need to be adjusted, but without changing the meaning of the answer any more than any good editor would.

I used to think it was possible, at least in principle, to have a few rare questions with identical answers that should stay separate. Now I'm not so sure, but I can still be convinced. Here's your chance!

13
  • How about a question which is a subset of other broader question with an answer covering both questions? Is that considered as trivial? (can't provide concrete example for now; on SE app) Oct 3, 2015 at 20:31
  • 1
    @AndrewT.: Well, that would seem to violate the first restriction, since a proper subset is by definition not fundamentally different. Oct 3, 2015 at 20:32
  • How can you have a question which is answered in another question but is not a dupe? Either it's a dupe and should be closed, or it's not and so should be different info/answers. Or, they could just be both "localised" so the difference (and so not a dupe) is just user specific things. And even then, we are here to answer specific user questions, as long as a previous/other question cannot answer in a generic way (etc).
    – James
    Oct 4, 2015 at 2:12
  • @James Did you see my answer below? Oct 4, 2015 at 2:50
  • 2
    @James: If you have a thorough, absolute proof that such Q-Q-A triples cannot exist, go ahead and add it as an answer. Otherwise, the presence or absence of valid examples here is really the proof in the pudding. Oct 4, 2015 at 2:53
  • An absence is proof of nothing other than there's currently no argument against. Also, your question is currently just asking if such scenarios exist, my comment was a valid discussion point as I don't see how such scenarios can exist.
    – James
    Oct 4, 2015 at 14:06
  • RE the below answer examples, I (like many others) cannot comment as working knowledge of the tech is required. If the alignment in Eclipse is done "the same way" for both Java and C/C++ code, then one of the questions is a dupe of the other. If there is an entirely different approach to alignment in Eclipse for Java and C/C++, then they are not dupes. The site already has procedures to manage both scenarios. Either duplicate one for the other, or leave as they are. If questions are not or cannot be answered elsewhere then they are fine to be open. "Similarities" does mean a "dupe".
    – James
    Oct 4, 2015 at 14:11
  • @James In Eclipse, each language has a different perspective, and perspectives have different features. This means that quite often a solution works for one language but not for the other languages. As a result, both questions are different. Oct 4, 2015 at 15:46
  • @FranckDernoncourt So, not a dupe then? They are different = not a dupe. There are many questions which are of the same programming language or technology or topic which are not dupes of other questions but could answer the other questions. This is simply "similarity". An answer which touches on a fair bit of advice can answer another question, even though both questions are not really dupes. It is a minefield, but I think the solution is simply determining if dupe or not. And yes, debates and opinion will always exist, such is the nature of a huge site which allows closing as dupe.
    – James
    Oct 4, 2015 at 15:53
  • @James I agree, but some comments from other people say the contrary… e.g. "The answer applies to both questions, so the questions are duplicates." Oct 4, 2015 at 15:54
  • 1
    On Travel, "How do I get from A to B" may be closed as a duplicate of "How do I get from B to A" - suggesting there is really an ur-question about getting between A and B. Posters have argued strongly they are not duplicates but opposites. Answers are occasionally direction-specific. Eg travel.stackexchange.com/questions/2995/… I argue in favour of ARRIVING over water, but it's been used as a dupe answer to someone wanting to leave for the airport, where that argument doesn't hold. Would this qualify? Apr 20, 2017 at 15:55
  • @KateGregory: It might. Write up a good answer making the case and we'll see. It would seem the key there is that some, but not all, answers are precisely identical, and the others are very different. Apr 20, 2017 at 19:58
  • codegolf.stackexchange.com/questions/102370/… - one of the answers can answer 51 different questions (although an individual "print X in Y language" question would probably be considered trivial)
    – DavidW
    Apr 26, 2017 at 12:44

3 Answers 3

24

Here is what I believe to be an example. Eclipse is an editor that software developers use write code in many different programming languages such as Java, C, and C++.

Question 1: Eclipse: Auto-align "=" in assignments.

The question asks for a solution to format Java code in Eclipse as follows:

// Without formatting
private final String s1 = "10011";
private final String s2 = "01100";
private final String ones = "11111";
private final String zeros = "00000";


// With formatting
private final String s1    = "10011";
private final String s2    = "01100";
private final String ones  = "11111";
private final String zeros = "00000";

Question 2: Eclipse - "Align Field in Columns" C/C++

The question asks for a solution to format C/C++ in Eclipse as follows:

// Without formatting
int mRect = 0;
int mSquare = 0;
bool isTriangle = false;

// With formatting
int  mRect      = 0;
int  mSquare    = 0;
bool isTriangle = false;

These two questions are different because the first one asks about Java, the second one asks about C/C++. In Eclipse, each language has a different perspective, and perspectives have different features. This means that quite often a solution works for one language but not for the other languages.

For example, the following answer only works for Java:

PreferencesJavaCode StyleFormatter → goto Edit and check the Align fields in columns:

Align fields in columns

Here is an answer that works for both Java and C/C++, i.e. that answers to both questions at once:

You can use the Eclipse plugin columns4eclipse:

  • gratis
  • open source
  • I've tested it with Eclipse 4.3 x64 and 4.5 x64 on Windows 7 SP1 x64 Ultimate

enter image description here

As a result, I believe that both questions should be kept open (as they are not duplicate) and that the proposed answer correctly answers both questions.

21
  • 4
    Interesting. If it wasn't for the existence of the first, language-specific answer, I would say these are clearly the same fundamental question (having to do with using an editor's feature), but that makes things trickier. Oct 3, 2015 at 20:49
  • @NathanTuggy Each perspective is very different in Eclipse. You can think of it as an editor within a meta-editor. A solution might work for just one editor (i.e. one perspective), while another solution might work for the meta-editor (Eclipse, i.e. all perspectives in Eclipse). The person who posted the question on C/C++ had seen the question on Java (he linked it in his question), but the solutions he found there for Java were not working for C/C++. Oct 3, 2015 at 20:51
  • I've used Eclipse, yes, for several different languages, although it was never my favorite IDE. Oct 3, 2015 at 20:55
  • 9
    The answer applies to both questions, so the questions are duplicates. You can close one as a duplicate of the other because the answer will solve the issue at hand. Oct 3, 2015 at 21:12
  • 4
    @MartijnPieters What do you do with answers that only answer one of the two questions, like the example I gave that is Java specific? Oct 3, 2015 at 21:12
  • 1
    @FranckDernoncourt: nothing; closing a question as a duplicate doesn't mean that existing answers need to be deleted or altered. Oct 3, 2015 at 21:13
  • 3
    @MartijnPieters No but closing means that you cannot post new answers that are specific to Java or C/C++. That's the problem.. Oct 3, 2015 at 21:14
  • 7
    @MartijnPieters: I think you're assuming the conclusion here. The point of this question is to see if there are any Q-Q-A tuples that don't satisfy the usual assumption that duplicate answers mean duplicate questions; simply restating that assumption is of no real value. If the questions are blatantly, self-evidently duplicates by their inherent semantics, that's worth explaining, but it seems there's some reason to suppose they have different answer sets and stem from at least partially different causes. Oct 3, 2015 at 22:41
  • 1
    "Here is an answer that works for both Java and C/C++" So mark the other one as a dupe of the one which answers both. People will find either from tags and keyword searches as the one closed as dupe remains as a signpost. Or don't, leave them both open. I personally really don't see an issue with either choice - leave both open or dupe for the one which caters for both. Not sure what could be "improved" or "resolved" from this example scenario.
    – James
    Oct 4, 2015 at 14:16
  • 4
    @James Closing one question as a dupe means that you cannot post new answers that are specific to Java or C/C++. That's the problem. That is why I think both questions should be kept open. Oct 4, 2015 at 15:44
  • 4
    @James There might exist some better solutions specific for question B, hence the need to keep it open. I agree it boils down to making dupe decisions accurate. Oct 4, 2015 at 16:02
  • 2
    @Won't The Eclipse plugin columns4eclipse: works for both Java and C/C++, and therefore answers the two questions Jan 2, 2017 at 16:58
  • 1
    But... a product recommendation isn't exactly the best example. In fact, recommending the same product across many questions is pretty much spamming. Without a technical answer that can apply to two absolutely different questions, I disagree.
    – user1228
    Jan 2, 2017 at 17:00
  • 1
    Hmmm, This is meta.se, so point to you... This is the literal definition of spam, and many people (unless they specifically allow for it, e.g., software rec se) consider it as such. Not sure why you think people suggesting products (free or paid) wherever appropriate isn't. Point to me. Guess we're even.
    – user1228
    Jan 2, 2017 at 17:06
  • 3
    @Won't how about if we call it a "solution"? Remember, only questions about product recommendations are problematic, but if a product happens to solve the problem stated on the question, is alright.
    – Braiam
    Sep 4, 2018 at 16:29
11

So I just ran into this issue and again it's kind of a tag issue really. Someone asks a question which effectively has the exact same answer as an question but TPTB pretty much never allow a single question to be tagged both and so someone searching for answer in one will never find the answer in the other

Of course in general webgl is programmed in JavaScript and OpenGL is programmed in C/C++ but the question can be one of how it works as in

Question: Why are my particles flickering

I have code like this

  float value = texture2D(someTex, float(intNdx) / someTexWidth)).r;

tags: WebGL, JavaScript

Answer:

Texture coordinates go from the left edge of the left texel to the right edge of the right texel so to use an integer index to look up the value of a specific pixel you need to add half a pixel

  float value = texture2D(someTex, (float(intNdx) + .5) / someTexWidth)).r;

And then

Question: Why does my math change depending on machine

code

  uniform sampler2D texA;
  uniform float texAWidth;  // width of tex A

  ... intOffset ... is an integer offset into texture

  float value = texture2D(texA, float(intOffset) / texAWidth)).r;

tags: OpenGL, C++

Answer:

Texture coordinates go from the left edge of the left texel to the right edge of the right texel so to use an integer index to look up the value of a specific pixel you need to add half a pixel

  float value = texture2D(texA, (float(intOffset) + .5) / texAWidth)).r;

Should one of those be closed as duplicate? They don't share tags. They have effectively the exact same answer.

6
  • Q1: How do I convert response headers into a map? [Java]
  • Q2: How do I verify a response contains a header key-value pair? [Java]
  • A: Import a library like "x" and call response.getHeaders()

For Q1, A is accepted as the answer; for Q2, another answer that solves via regex was accepted.

For Q1, the solution does exactly what the OP asked, so it is considered the best (easiest) solution. While the answer does also solve Q2, the problem is that bringing in a whole library is overkill when something built into your programming language can do the same job (verification), so their is better (simpler) answer that cannot be applied to Q1. The two questions are fundamentally different (one is manipulation, the other is verification), but they can be solved the same way (with minor insignificant changes specific to the question). While all answers to Q1 could be used for Q2, not all answers apply to Q1, and the accepted answer won't work for Q1 at all.

Since the answers have different values/relevance to each question, they need to be duplicated so that they can be properly quality controlled.

You must log in to answer this question.

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