2

If the answer to a proposed duplicate question can be solved by the accepted answer to an existing question, but the new question specifically asks about a specific tool/technique then is it really a duplicate question? Or just a duplicate answer?

There are many ways of solving problems within unix platforms that may not be applicable to a one or other *nix variety, or the asker may have specific restrictions with regard to the command they want to use - even it is just for educational purposes. Eg. a question could be asked about grep that has solutions in sed, awk, perl, etc.

Commenting and pointing the asker at other techniques to solve their problem, including other questions with answers, is all very good and helpful, but is it fair to call it out as a duplicate question?

1

3 Answers 3

7

In general I don't like to give answers that ignore part of the question; nobody would answer a question about Chrome with "here's how you do it in Firefox". But is turning into rather a special case -- people constantly specify a particular tool when they don't actually care what tool is used. I prefer to check first, and ideally edit the question if it turns out the asker doesn't care, but in a large majority of cases it seems like the particular tool doesn't matter.

On the other hand, if the asker really does care, you have to deal with it. I've seen cases where the asker says "no seriously, I have to use X" and people keep telling them they're wrong and they should really use Y. Answers that ignore part of the question that the asker clarifies is actually important are considered non-answers and can end up deleted

1
  • 1
    I'm sure there are grey areas, and anything tagged text-processing is more likely to fall into one of those grey areas :) I agree and think checking with the intention of original poster, and asking them to clarify is a kinder and gentler path than immediately flagging as a duplicate.
    – DanSut
    Commented Oct 12, 2015 at 13:33
5

Yes.

That's one of the consequences of the XY problem.

Users tend to name out tools which they think might solve the current problem using the current approach. I have often seen people tag a question , , , and anything else they imagine can be used.

In the very case you mention, OP ends up using ed! Not grep, ed!

If someone is interested in grep, they can (and should) stress that they are interested in only grep, maybe specifying the reasons for such a choice.

"The right tool for the right job." is the default position, unless other conditions apply.

2
  • 2
    So maybe the default should be to ask in comments if user is falling into XY problem, or really does want an answer specific to Y or wants problem X solving? Especially if the tags and question subject both specify Y, even if poster isn't doesn't further stress a Y solution and give reasons. Also, maybe someone later is really searching for the best way to put screws in with a hammer, even if the original poster wasn't ;)
    – DanSut
    Commented Oct 7, 2015 at 18:12
  • @DanSut that someone can post a more specific question. No, IMO the default position should be to use the best tool and educate the user as to why it's better, unless there's extenuating circumstances. For example, recently a poster asked about scripting in csh. Both answers at the time I saw it said: "don't use csh", though such a requirement is weird enough that both tried to work around csh's limitations.
    – muru
    Commented Oct 7, 2015 at 18:19
1

My opinions:

It's not a duplicate question, however:

  1. It should be noted in the question very clearly (by the asker) that (a) he knows how to do it using other tools and is aware of those other tools, and (b) he wants an answer specifically for the tool he is asking about.
  2. A link should be provided to the more general question which contains answers for other tools. The link should be included by the asker, either in the question body or as a comment on the question (by the asker).

Regarding the answers to questions that ask about specific tools:

  1. If the asker followed point (1) above, then don't post an answer that uses a different tool. Post such an answer at the question linked as per (2), instead.
  2. If the asker asked about a specific tool but didn't specify that he is not interested in other tools, you can answer with another tool, but:
  3. Preface your answer with something like "I'm not sure how to do this with X, but there is a simple way to do it with Y, as follows:"
  4. If you know how to do it with X, even if it is more complicated than with Y, answer the question—say how to do it with X. You can say how to do it with Y also. Or at least say, "You can do it with X, but it's very complicated; you'll have to research Z, Q, F and B to write your settings file for X the way you want. In Y it is simpler..." (This is if it is so complicated in X you don't want to do all that work yourself.)
  5. If it's complicated to do it with Y, you can still post how, but at least acknowledge the fact that it's probably more complicated than needful. "I don't know how to do it with X, but you can do it with Y as follows. It might be more complicated than with X but it works."

Points 5-7 above are the key to avoiding downvotes on this type of semi-off-topic answer. It can be a totally valid answer to post, because it might help someone, even if not the original asker. However, leaving out those statements makes it not actually an answer to the question asked; hence you are likely to get downvotes.

That's my opinion, of course.

You must log in to answer this question.

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