18

This morning I answered (>10k) a question on Stack Overflow. Someone here commented on my answer, saying that it was a bad practice to answer a dupe.

I really don't like the solution in the dupe he linked, plus it doesn't solve the whole question (getting rid of some spaces too).

What should I do if this case ever happens again?

Should I look for a dupe that doesn't necessarily answer the whole question, or should I answer directly, since I know an answer?

3
  • 4
    The linked question has now been closed as a duplicate that I think does answer the whole question. General point of this meta question still stands. Jan 15, 2018 at 9:50
  • 7
    In my view, it is often a lot easier to answer a question than to find duplicates for it. Certainly, in the areas I frequent, that is emphatically the case. I think that if SO wants questions closed as duplicates, it will invest some energy in providing tools to make it easier to find the duplicates. There have been other questions before on the topic, which have effectively been ignored by SO staff. Preliminary conclusion: the SO organization doesn't care whether questions are answered or closed as duplicates. Possible alternative: they think other things are more important than this, but… Jan 16, 2018 at 7:54
  • 3
    If you were able to answer it, it wasn't a dupe at the time. Some people - fewer than the close count - may believe it is a dupe but it doesn't mean they are right. I always check the claimed duplicates out to make sure they really do answer the current question. If I believe they do, I add my close vote. If I believe they don't, I add my answer and a comment as to why I think the claimed duplicate is not a duplicate.
    – JeremyP
    Jan 16, 2018 at 11:31

1 Answer 1

22

The question comes down to "How to select only direct child text nodes and trim the whitespace from the result?".

Those are two questions in one, and both have been asked plenty of times before. Either vote or flag to close as Too Broad, or find the most sensible duplicate about filtering nodes, vote or flag to close as duplicate of that one, and link to Trim string in JavaScript? in comments.

Because $deity forbid, in an hour someone is going to ask "How to select only direct child text nodes and append a string to it?", and alas, we have a new question and five new answers.

8
  • 2
    Ok, so in a more general case : Flag as duplicate for the main issue and link the other issue in the comments ?
    – Zenoo
    Jan 15, 2018 at 9:30
  • 3
    @Zenoo, or flag as too broad, since more than one question is being asked. Although in my experience those flags do not fare too well.
    – yivi
    Jan 15, 2018 at 9:35
  • Alright, thanks, will do in the future.
    – Zenoo
    Jan 15, 2018 at 9:38
  • "Those are two questions in one" -- related discussion
    – jfs
    Jan 15, 2018 at 19:13
  • 3
    note: a question can be closed as a dupe of several other questions (several dupe links) that is if the question is "how to do X, Y", it can be closed as a dupe of questions "how to do X", "how to do Y" unless the question specifies explicitly that X, Y together can be solve differently from solving X, Y alone.
    – jfs
    Jan 15, 2018 at 19:14
  • @jfs gold tag badge holders can do that indeed. I'm not sure if that's accepted behavior though.
    – CodeCaster
    Jan 15, 2018 at 20:18
  • 7
    @jfs: "it can be closed as a dupe of questions "how to do X", "how to do Y"" -- FWIW, it's my opinion that if a person asks more than one question, while closing as "too broad" can be appropriate, closing as any duplicate that answers at least one of the questions is fine. In this view that I hold, since either target duplicate would be appropriate, it's also fine to include both, i.e. editing the duplicates list to add an answer to additional questions the OP asked. This is IMHO a preferable result to then having the OP post a new question with just the second part only to be closed again Jan 15, 2018 at 21:32
  • 1

You must log in to answer this question.

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