13

From this answer on the related question What should I do if the question I need is already asked, but in a poor way?:

The correct way of moderating duplicate questions is not to use the oldest post as dupe target but the highest quality post. So if you believe that you could ask a better question and/or receive better answers than an already asked question, go ahead. In particular, if the other question has not received an answer, it should not be used as a duplicate target.

I commented on that answer in part:

Maybe I just assumed for no good reason, but I've always thought the correct, or maybe 'just obvious', dupe target is the oldest question.

On reflection, I agree that, if there are duplicates, and they're not already marked as such, it would be better to use the highest quality question as the canonical "dupe target" for the others. But, as I mentioned, I wasn't aware of that 'policy' (nor have I seen much, if any, evidence that anyone else has followed it).

Assuming there is broad agreement that this is the best policy, what could we do to better communicate it (to the users that bother to read the docs)? Can we propose edits or changes to the official help docs?

Generalizing, should we (and can we) edit existing duplicates to change which is the canonical question too? (I think it's reasonable to do this, but only when it would be, overall, less work than editing any of the questions, or adding new good/better answers.)

An similar Meta question to this one:

This is very much part of the scope of this Meta question:

But from that question's description:

This is a sort-of meta-meta question in that I would expect a popular answer to be "start a discussion on https://meta.stackoverflow.com/", but given the extensive scope, we are talking about maybe 50-100 posts on Meta, not just an individual posting

9
  • 1
    Questions can also be duplicates of multiple questions. You can always suggest another dupe candidate in the comments and then someone else might VTC is as a dupe of the other. Or a gold badger might add it, as they can edit the dupe candidates.
    – Thom A
    Commented Nov 29, 2021 at 16:11
  • @Larnu Of course – this question title explicitly allows for 'multiple duplicates' ('multiplicates') – and of course that happens too. But I'm not asking about the mechanics of closing questions or otherwise marking them as a duplicate of another. I'm asking about some kind of consensus, of which I'm currently ignorant, as to which of some number of duplicates should be the canonical question. I probably just assumed before that it should be the oldest question, but I'm now convinced it should be the 'best' one instead. Do others agree? Commented Nov 29, 2021 at 16:15
  • 1
    Honestly, I'm not sure it matters too much. VTC the question as a dupe of the question you best think fits the OP's problem. If there are multiple duplicates that all fit that, then personally I would say that the one with the most votes seems a good "tiebreaker", as it's the question/answer that has been the most well received; if you want to VTC as the oldest that fine too but just make sure that it's good quality (some old questions though have a good amount of votes are much lower quality than some more recent ones).
    – Thom A
    Commented Nov 29, 2021 at 16:19
  • @Larnu Why not add your 'use the one with the most votes' (where I'm guessing you mean upvotes or highest overall vote score) as an answer to this question? That's a reasonable metric to use – a decent proxy for 'best'. But – ignoring practical considerations (which I agree usually 'dominate' others) – you seem to agree that it'd be better to use the 'best' question as the "dupe target". I'm mainly curious whether others agree with that aim. Commented Nov 29, 2021 at 17:09
  • Most upvotes... is often just a measure of age, and how often people encounter that problem, unfortunately.
    – Kevin B
    Commented Nov 29, 2021 at 17:11
  • 1
    Yes, Kenny, my statement should be read as "the one with the most [up]votes". It would be silly to vote on the question with the most [down]votes ;)
    – Thom A
    Commented Nov 29, 2021 at 17:11
  • @KevinB Sure, but then 'most upvotes', or even age directly, might be an eminently sensible choice as it would consolidate info on the question that people have and are mostly like to see when they "encounter that problem". Commented Nov 29, 2021 at 17:18
  • 1
    I usually give preference to whoever asked something first, rather investing time and polishing the first question. Only if that would be too much work, I consider later ones and then simply the one with the highest quality and best answers. Commented Dec 1, 2021 at 8:19
  • @Trilarion That's very sensible – I think I will, in the future, opt more readily to consider contributing to newer, better questions in some set of duplicates. Commented Dec 1, 2021 at 17:48

3 Answers 3

7

The metric that should probably be used is ... common sense.

If it feels like the oldest post is de facto canonical, it can usually be attributed to survivorship bias. Sometimes the first question asked became the canonical, but in many cases, there were questions before it that are now either deleted or hidden in the depths of Stack Overflow.

When closing as duplicate we choose questions that have the best quality answers - ones that provide the best and clearest guidance. Score and view count are usually good indicators of the overall quality, but it's not a rule that we must follow. Everyone is expected to work in the best interest of the community to find the best answers possible. The canonical post that we select may vary case by case. Use the one that answers the new question the best.

There's always going to be differing opinions. It's your prerogative as a voter to select the one you feel is the best, and it is other users prerogative to later change it or offer a better alternative. There isn't a policy, there's common sense.

In rare cases, it might be that you can't find a question of adequate quality to use as a canonical. Feel free to ask a new one, self-answer it, and then close older questions as a duplicate of this one. Just make sure that there really isn't one that can be easily improved and used for that purpose already.

4
  • What does "NPE" mean? And your answer seems to be 'use the best question' but also contorts itself to try to avoid stating that directly. Given that I asked this question, pointed out my own (previous) understanding and how that differs from another understanding, appealing to "common sense" seems extremely unhelpful. Commented Nov 30, 2021 at 17:13
  • 1
    @KennyEvitt I removed that part. I am not sure what answer you were expecting. Can you help me understand what answer you would consider as helpful? At the end of the day, nobody is policing which duplicates we use for duplicate closure.
    – Dharman Mod
    Commented Nov 30, 2021 at 17:20
  • It seems like you agreed that the canonical question should be the 'best' one but also went out of your way to try to avoid stating that clearly. 'Do your best' is unhelpful because it's non-specific. You don't seem to be arguing that 'use the oldest question' is sensible – as a blanket policy – and I agree, and I also agree with a lot of what you wrote, but I wanted answers that provide clear guidance about which question should be the canonical 'dupe target' – even if, in practice, that guidance would be muddled by circumstance. Commented Nov 30, 2021 at 17:58
  • I'm a big fan of common sense but in this case you will also need technical domain expertise. Determining which is the best post out of many for a certain issue often requires quite in-depth knowledge of the topic, like for example a gold badge. Ideally the canonical duplicate for a certain post should be determined by consensus from several gold badgers.
    – Lundin
    Commented Dec 1, 2021 at 11:09
4

The way SO handles duplicates is unfortunately flawed both by design and by practice. The thoughts from my meta post that you quote originate from several discussions on a different Q&A site, where we are trying to build something better than the current system at SO. The original discussion regarding that can be found here, quoting my thoughts from there:

("Somewhere Else" in the text is a recurring joke referring to Stack Exchange.)

Question closure can leave people feeling judged (as we learned Somewhere Else) ...counter the impression that duplicates are bad

To solve that problem, one needs to address the source. Somewhere Else would instantly make a conclusion like "aha it's the evil community being rude again" and then come up with some misguided system to counter that. But by applying a slight bit of empathy, we can get to the root source:

The people who cast duplicate close votes Somewhere Else are fed up with endless duplicates. Newbies asking the same question over and over again, with little to no research effort made. Therefore the regulars get tired of that behavior and just close the posts without providing much feedback to the person who asked the question.

There exists a somewhat rare phenomenon though: sometimes when a high quality question that is a dupe gets asked, it is left open long enough for good answers to pop up. And when this happens, this new question might actually turn into the "canonical" target for duplicates. And then the old, present duplicates get closed with the new post as target. It's a very good thing when this happens. The old duplicates of diverse quality are not necessarily the best ones.

But most of the time, new questions that are duplicates just get closed with an old post as target, because that's how the system was designed.

Somewhere Else is suffering from the results of this: there's a lot of old posts with canonical status but so-so quality. Also such posts tend to attract a whole lot of answers over time, where everyone and their mother feels inclined to contribute even though they aren't adding anything new. Or in case they are adding something new, they only add that part and not a complete answer. So over time the canonical post "fragments" into several answers and the result as whole is not very good.

It would be better if these old posts were recompiled into complete answers and one natural way to do that is to close them when something better and more complete shows up. But the duplicate system often doesn't let that happen.

We shouldn't close posts as duplicates unless there exists a high quality duplicate target. If a question has been asked before, then that alone should not be a reason to close it.


A perfect example of a post with diverse quality, but with canonical status, is the SO canonical post used for the #1 most frequently asked C and C++ question. That question is along the lines of this one asked just now, asking for the result of combining several i++ operations in the same expression. This question gets asked around 10 times per week or so - it's by far the most common C and C++ question.

The canonical dupe target is: Why are these constructs using pre and post-increment undefined behavior?. The question itself is good with lots of examples, but each individual answer is actually not that good at all. They are individually incomplete and lack detail - in order to truly understand the problem, you have to go through multiple answers, each containing various pieces of the puzzle that makes a complete answer.

A good complete answer to the question would have to address the following:

  • Side effects and sequencing/sequence points, with sources.
  • Undefined behavior, with sources.
  • Bug fixes: how to write the code properly instead.

Looking at the top-voted answers in this post, the top voted/accepted one with +596 is plain bad. It is basically just "this is undefined behavior, don't worry your pretty head about it". Likely it gets massively upvoted because it was accepted and people always refer to the above link out of habit.

The +79 voted one by haccks is a great answer. The +78 voted one with a few quotes is incomplete since it lacks explanation and context. The +76 voted one showing disassembly is plain bad and dangerous. Some good answers by various other resident C gurus follow, though these are also fragmented. One person even felt the need to post two different answers.

So how can we fix this mess? We can't... The proper way if we only care about quality would be to filter out the good question by PiX and the great answer by haccks, then nuke everything else and lock the post. But that's not how we treat posts on SO in general or canonical posts in particular.

Alternatively, someone could make an effort to compile all the fragmented answers into a single great post, perhaps post it as community wiki, have several other domain experts peer review it and then close the present canonical post as a dupe to the new one. This can be done in theory, but in practice it's hard to coordinate several domain experts into such an undertaking.

4
  • 3
    "…the top voted/accepted one with +596 is plain bad. It is basically just 'this is undefined behavior, don't worry your pretty head about it'." I have to disagree with you there. While I agree it would not be very useful if that was the only answer available, I think that it only makes sense for that to be the top-scoring and accepted answer, as that's the answer that is most useful to the vast majority of people. While you and I might care about the details of why and what the standard says, most programmers don't, and don't need to. This is all the info they need, stated simply.
    – Cody Gray Mod
    Commented Dec 1, 2021 at 9:24
  • 1
    I don't see why this establishes a flaw in the way that SE handles duplicates by design, either. You can always find questions with answers that are sub-par, much less nitpickable, but does that argue that future questions are not duplicates of this? What good would it do to scatter the discussion out across multiple questions, having it again and again? Would you just do this until someone magically comes up with a good answer on one of the attempts? While you may dislike the ordering of answers on that canonical, at least correct answer appears, far more than you can say for rehashed dupes
    – Cody Gray Mod
    Commented Dec 1, 2021 at 9:27
  • 2
    @CodyGray A good answer could be brief and detailed at the same time - it could include a "TL;DR" section at the top for beginner/intermediate readers. But this top-voted answer doesn't even contain that, because it doesn't explain what exactly in the code that is undefined behavior. Typing the letter i or what? There are some aspects of code like this which isn't undefined, but merely unspecified and deterministic behavior. In fact most of these "i++" examples contain both undefined and unspecified behavior. As for explaining what undefined behavior is, that should be a separate post.
    – Lundin
    Commented Dec 1, 2021 at 10:51
  • 2
    Anyway, the main points here is that most canonical duplicates on SO are old, not necessarily the best post on the site, very often fragmented into multiple answers and overall often not good study material for someone encountering a certain technical issue for the first time.
    – Lundin
    Commented Dec 1, 2021 at 10:55
2

Be objective.

There's not going to be a one-size-fits-all approach to which duplicate is "canonical", since depending on the technology, it could be the case that what was canonical two revisions back is now deprecated or removed or superseded by something else.

For instance, in Java, NullPointerException is going to be a tale as old as time, but perhaps there's some nuance in how you can ensure that threads are scheduled on a specific schedule as opposed to per-second.

Use your best judgment in these cases and allow yourself to make a mistake when applying it.

6
  • 2
    A long time ago, in a galaxy far away... NullPointerException. Chapter IV: A New Autoboxing.
    – Gimby
    Commented Nov 29, 2021 at 16:50
  • Ideally, the canonical question should cover changes for different versions, and it'd be easy enough to add that to the best answer on whatever question 'should' be the canonical one. Still – all else being equal (which, as you point out, it never is) – should we default to picking the oldest question as the canonical one, or should we pick the one we think is 'best'? Commented Nov 29, 2021 at 17:05
  • 1
    best, always. How is that even a question?
    – Kevin B
    Commented Nov 29, 2021 at 17:06
  • 4
    I don't tend to look at age when picking a duplicate, @KennyEvitt. If the question is about NPEs, then I use the best NPE question I can find. "Best" can be an objective measure if you look at how well the question is received (upvotes/downvotes ratio) and the quality of the answers attached and how well those are received too. Yes, legwork needs to be done. No, it's not a one-and-done kind of thing. Take your time with it.
    – Makoto
    Commented Nov 29, 2021 at 17:06
  • The only reason "oldest" was ever thought of as the correct choice is because people inherantly see closure as a form of punishment, and therefore choose to close the "newer" one as a dupe of the "oldest" because the newer one failed to research. That's simply backwards, as we should be driving people to the best answer, not the oldest.
    – Kevin B
    Commented Nov 29, 2021 at 17:09
  • @KevinB I don't think that's true of me. I think I defaulted to picking the oldest question as the canonical one because of my background in 'data scrubbing'. And part of that (implicitly) involves retaining/copying any good/accurate newer info from any 'future duplicates'. (Tho it can happen that, practically, retaining a newer version is easier, hence it being only a default.) I've never thought of closing a question (for any reason) as a punishment – my aim (when I've bothered) has been to cleanup the shared resource that is this site. (I agree many others probably feel differently.) Commented Nov 29, 2021 at 17:14

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