32

I have encountered a problem many times while trying to fix up canonicals, where a question would be great for explaining a common problem (and already has high-quality answers) - if only the question weren't so specific to irrelevant details of OP's situation. Typically, answers will be written that address the details - especially including things that aren't obvious to the asker, but can be determined, e.g., from the details of error messages

If I know that the problem described in a question is an example of a more generic problem with fundamentally the same solution, should I interpret the question as if it were already that broad? The actual breadth of the question is generally not evident, since questions are typically just phrased like "how can I fix the error?", etc. (Does this mean, any error with the same underlying cause? Or just the error in the actual MRE as it stands?)

If so, how can I make the breadth of the question more obvious to others? How can I help the question come up in external search engines, for everyone who should be directed to it (i.e., including people trying to install things that aren't NumPy)?

If not, can/should I edit the question so that it clearly has the appropriate breadth? Should I create a new Q&A pair, with my answer for the general version of the question, and mark the existing question as a duplicate? Something else?

My primary goal here is that every question about the generic problem gets routed to the same canonical, because they should. The questions are duplicates, it's just that the people asking them have no realistic way to determine that - and, because each is asked about a specific scenario that is different, but in an irrelevant way, it's often difficult to choose one to use for the general case.


Some examples (but I do not want the discussion to be question-specific):

https://stackoverflow.com/questions/51922364 is the best I know of for the general problem: there are multiple Python installations on the system, and running pip (or pip3) installs new libraries to a different one vs. (the one that runs using python or python3 or py at the command line, or the one that some IDE has been set up to use, etc.) The underlying problem is really the same regardless of the details, and it especially doesn't matter that OP wants to install NumPy specifically.

https://stackoverflow.com/questions/6039605 is what I've been using as a canonical for problems where trying to use a built-in function or class doesn't work because the name was previously reassigned in the code; trying to use the built-in instead accessed whatever was assigned, which is not fit for purpose. The problem is not specific to str (input and list are also commonly clobbered like this); the attempt to use the built-in after the assignment could be anywhere (not simply caused by a loop); the error message could be practically anything (depending on what was assigned); the reassignment of the name could take other forms (e.g., trying to write one's own function named str). But it's still the same problem regardless.

There are countless questions along the lines of "how do I get from a list of X to a list of Y?", or "how do I process all my Xs in the Y way", or "how do I Y-ify each X in a list of Xs", etc. In practically every case, the appropriate answer is: if Y-ify means creating a new value based on X, figure out code that converts from X to Y, then use a list comprehension to apply that code to each element. Alternately, if "Y-ify" means to "do something" rather than to create a new value, just write a for loop. There are some variations on the theme, but the problem decomposition is basically always like that - because each Y-ification is independent, and there isn't really a way to take advantage of the fact that we want to process an entire list at once, we need to iterate over it. Sometimes it's not clear whether OP actually knows how to Y-ify a single X, and whether that is separately being asked. Sometimes we end up with rather high-quality QA pairs for specific versions of the question, e.g. Convert all strings in a list to int. I have closed a lot of questions as duplicates of Apply function to each element of a list, after some considerable fix-up work. But even that isn't really general enough - because sometimes Y-ifying an X can be done with a simple expression like the_x + foo, rather than needing to call a function; and sometimes we want to call functions for their side effects which typically shouldn't use a list comprehension. But it seems like a clear violation of authorial intent here to broaden "apply a function to" into "modify" or "process".

2
  • 2
    I mean you could create a new canonical post containing the very broad answer (which is good) and maybe list the duplicates for specificity. Not sure if editing the question helps, because then the answers will not be really answering the question due to the broader question with no specificity.
    – DialFrost
    Aug 28, 2022 at 4:28
  • 2
    This idea is really good and I really look forward to it, but doing so may take a huge amount of time, effort and manpower.
    – DialFrost
    Aug 28, 2022 at 4:29

1 Answer 1

9

A key issue for these questions is not that the question is potentially duplicate, but that the answer might be. The asker only has their own knowledge and experience as a reference for how to describe their issue. In most cases, if they understood the general concept or how their code related to it, then they would have already found the answer. In other cases, they might not understand how to apply the solutions in the canonicals back to the original issue.

If I know that the problem described in a question is an example of a more generic problem with fundamentally the same solution, should I interpret the question as if it were already that broad?

No, if by making that assumption you will choose this question to be a new canonical. You have already identified this question as not an authoritative source.

how can I make the breadth of the question more obvious to others? How can I help the question come up in external search engines, for everyone who should be directed to it

If the question is a good example of a more generic issue, but to make that link requires anything more than a comment, then you should post a new answer. In that answer, link to the canonical and include a short explanation on why it is related to the canonical, and importantly, if there is a code example in the post include a specific code example in your answer that shows how you have applied the solutions offered in the canonical to OP's scenario, yes this should focus on the details.

  • I feel this is a concept often overlooked by the community when it comes to duplicates, not only is OP often confused by the duplicate being assigned, but the next reader who has a similar problem to the OP is likely to also be confused by the duplicate, but now potentially discouraged from posting their own question.

Use the answer approach to preempt the discussion that you know you want to have. If you feel like you might have to justify the duplicate to OP or other users, then an answer is the appropriate way to do that. Just include some effort to directly answer the OP and don't focus exclusively on the canonical.

Answers are still indexed by search engines, although their weighting is lower because the title of the question does not match. A good answer that includes relevant links and includes constructive use of keywords is still potentially of more value to external search engines than it is to SO.

You shouldn't edit a question to make it a duplicate. That is assuming too much knowledge about the original scenario, and in that case you might as well delete the question, especially if OP has already awarded an answer. But by providing a more relevant answer that is well documented and referenced, then you can be rewarded both with rep and kudos and still improve the visibility of the canonical.

  • If you are putting in this level of effort, then answers are the only way we can really reward you for this effort.

If the question requires editing to make it more generic because the additional content is not relevant in any way to the solution and is distracting some users who are commenting or answering only the additional content, and OP is not finding their feedback useful. Then if the edit makes this question more accessible to the community without changing the content, preserving the original code detail that is relevant and does not detract from the original intent, it might be appropriate to edit the question.

Should I create a new QA pair, with my answer for the general version of the question, and mark the existing question as a duplicate?

If the edit will be substantial, and there is not already a high quality canonical, then you should post your own question and answer. Then see my previous point above about submitting an answer that links to your new canonical.

If your new post is close enough to the OP that you do not need to justify the link then it might be a good candidate to mark as duplicate. The same rules still apply, however often it is easier to approach it from this angle. In your answer to the new post, you might want to include specific references to the other post as an example on how to apply your advice, keep it minimal and generic. You still need to also post an answer to the original post, and that is where the specific detail to that original scenario should be described.

The rest of the SO community will find your answers if they are of high enough quality and it will make its way to the top. That is how the system was designed to work. If you need help, put a post in the chat boards, ask for others to review your post and provide some feedback for you.

Caveat - Old posts

If the question is very old and not active, then editing the question is not helpful unless you specifically wanted to draw attention to a new canonical. Editing old posts for the sake of it really just creates a fake steam of activity. If the question is significantly old and has not attracted many answers or views, then perhaps it is actually a candidate to delete. If it has good answers that should be on the canonical feed, then there should probably be a process where we can migrate these answers across, but if the question is vague this isn't going to help a lot.

For old posts if you can put a one-liner edit in the question as a footnote that explains the link to the duplicate generic concept, and if all the answers to the post agree or point to the same generic conceptual solution, then I think this type of edit and mark as duplicate is appropriate, otherwise just leave this question to continue to float into obscurity... If it is worth the effort to yourself to put in a new answer, then by all means, do that and get rewarded. Substantial edits will only serve to attract attention to a post that you have already identified as non-authoritative which by definition you don't actually want to attract attention to...

8
  • 2
    Part of the issue with the old posts is that in many cases they won't "float in obscurity"... the problem still exists with some that have quite high scores and view counts. You can get a situation where two or more old posts are both treated as "canonical" by different groups, both of which are specific instances of the same general problem that experienced users understand, without people realizing the link. They can both attract duplicate closures, choosing one or the other more or less arbitrarily. I suspect this is part of why people often complain off site about inaccurate closures. Aug 28, 2022 at 19:42
  • On the other hand, it's usually hard to "get rewarded" for adding to an old, popular question, because the "long tail of crap" problem has knock-on effects. All of that said, thank you, you've given me a lot to think about. Aug 28, 2022 at 19:43
  • 3
    "In most cases, if they understood the general concept or how their code related to it, then they would have already found the answer. In other cases, they might not understand how to apply the solutions in the canonicals back to the original issue." I have run into this as a question-asker. One of my questions was marked as a duplicate linking to a much more generic post. I didn't find the generic post because I didn't know how to describe my issue in the terms used in the post. It didn't help because I didn't know I needed to apply it to my issue.
    – TarHalda
    Aug 29, 2022 at 16:49
  • 6
    I feel you @Bellrampion too many times posts get closed as duplicate without anyone actually paying much attention. Its not enough to identify that the concepts are similar, the same question asked in a fundamentally different way should not be a direct duplicate, we should still put some effort in to close the gap and explain the link to the dup, otherwise it takes forever to get a post to be reopened, by that stage the good samaritans out there have moved on and OP doesn't get the help they need. Aug 29, 2022 at 17:11
  • I came back to this, and I think I haven't adequately communicated the problem. What happens most often is that there doesn't exist a sufficiently broad canonical; I have found what looks like the closest thing to that, but it isn't broad enough. My understanding of Stack Overflow logic is that what I am supposed to do is write my own canonical QA pair, wait until someone upvotes my answer or I can accept it, go back to the ancient question with hundreds of upvotes, make a short comment explaining how it's a special case, and dupe-hammer it to my own. But I'm sure everyone will hate that. Jan 18 at 13:48
  • I'm not sure creating new pair for every answer is the right approach @KarlKnechtel Instead provide your answer with a specific answer and then explain the mor general scenario. Over time we might all elect your answer and the question as the canonical. If you find multiple questions that need to refer to a new common canonical, then that is the right time to go and create one for the sake of it. Just make sure it doesn't end up 1:1, that doesn't help anyone. Feb 12 at 5:35
  • @ChrisSchaller ... but in these cases, "the more general scenario" isn't mentioned in the question, which is the exact problem I want to address. Feb 12 at 9:23
  • You can still answer and describe the more general scenario in the answer. But it you were going to go to the effort then I guess the right answer is to create the general question and answer, then answer the original question and include a link to the new canonical you created. You could then suggest the duplicate. If you don't want to go to the effort of a specific answer, then don't bother with the canonical at all and just provide a generic answer as the answer to that question. Feb 14 at 15:58

You must log in to answer this question.

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