114

Sometimes when I refresh after publishing my answer I see another answer, with almost the same code as mine, but better in some details (a small optimization I don't use, better modularization, etc). In this scenario I think of these possible actions to take:

  1. Delete my answer.
  2. Edit my answer to add the small improvement present in the other answer.
  3. Keep my answer, but make a comment telling why the other one is better.

#2 is clearly dishonest, and creates redundancy. #3 is honest, but it also creates redundancy. #1 keeps the site cleaner, but it feels bad (especially when the other answer is better in a way that doesn't relate with the question).

Until now I've always opted for #3. But I want to know if there is a policy, or cultural convention for this.

15
  • 2
    Related: meta.stackoverflow.com/questions/252451/… Commented May 26, 2014 at 5:30
  • 23
    I would upvote the better answer and leave a comment to guide the OP. So I guess that's your option 3. Commented May 26, 2014 at 6:22
  • 7
    More experienced users often immediately delete the answer (e.g. it's a simple question, their answer was posted afterwards). If there's no scope for improving the answer to be "best" I guess your choice is 1 or 3. There's typically always scope to make an answer better, e.g. this one has no explanation and is just a code dump. IMO code-only answers should be rejected as needing an explanation, but that's another matter.
    – AD7six
    Commented May 26, 2014 at 7:32
  • 1
    @AD7six I agree that answer is not really well explained, but I don't think it's just a code dump. If you look the code is commented (more that I would comment actual code). I just felt it was better to add the explanation as comments instead of breaking the code block with text.
    – jspurim
    Commented May 26, 2014 at 11:01
  • 12
    Try to earn Sportsmanship. Commented May 26, 2014 at 16:23
  • 3
    Here's a great example. This happens all the time on technical questions, and indeed, always remember that every single software answer eventually becomes redundant. Have a look at this answer: stackoverflow.com/a/550284/294884. Note that the answer is now hopelessly, totally, pathetically wrong. Note that many people are telling the guy to edit the answer. Due to the bizarre phenomenon of editing resistance the guy has not edited the answer. Note that in my (hopefully polite) comments I give examples of how to do it. editing resistance is a huge and bizarre woe.
    – Fattie
    Commented May 27, 2014 at 7:50
  • 1
    @JoeBlow Maybe we need a "historic interest" flag for answers. Commented May 27, 2014 at 14:33
  • 1
    Colin - I couldn't agree more. I've been telling everyone that for decades. It's just blindingly obvious that on any QA site, discussing software, in fact ......... EVERY SINGLE QUESTION BECOMES TOTALLY WRONG, AND THEN LATER, JUST UTTERLY REDUNDANT. 100.000000000% of questions on SO eventually become plain wrong, and then just archaic, totally irrelevant. I do what you suggest "manually", all the time, simply by editing .. here's an example! stackoverflow.com/a/2530953/294884It's a great point Colin, cheers
    – Fattie
    Commented May 27, 2014 at 14:39
  • 8
    @JoeBlow True, if everyone was up-to-date. We, for example, just dropped support for IE6 a month ago, but still have so many clients stuck on IE7 that it's not going away any time soon. Those "old" answers that ideally have become irrelevant have saved me and my co-workers many times over.
    – Izkata
    Commented May 27, 2014 at 16:03
  • I'd go for opinion #3.
    – nsane
    Commented May 27, 2014 at 16:34
  • 1
    As a matter of fact, there are many out there who would do #2. If you point out that why copy from the other answer, then they would argue that they are improving their answer.
    – devnull
    Commented May 27, 2014 at 17:06
  • 4
    @JoeBlow They're only redundant because the question never specified a particular version. If that is the intention, then sure, but most of the time when you have a problem, you likely have a problem with whichever version of some tool/library. An answer that is specifically for Java 5 will not become "wrong" just because Java 6 or 7 or 8 or 200 are released.
    – MxLDevs
    Commented May 28, 2014 at 15:30
  • 3
    Downvote the offending answer and do #2. *Runs away*
    – jliv902
    Commented May 28, 2014 at 17:20
  • 3
    @jliv902 - you forgot "and add a comment accusing the other respondent of plagiarism". Commented May 30, 2014 at 11:36
  • Whoever downvoted this should be booted from SO.
    – Pinch
    Commented Jun 2, 2014 at 19:49

9 Answers 9

84

I would upvote the other answer; and delete mine.*

* If it truly adds nothing new to the table, which seems to be the assumption in the question here. If it does I'd leave it.

2
  • 11
    then upvote above ;) Commented May 26, 2014 at 9:57
  • 1
    It is very unlikely that it trully adds nothing new. As said by PlasmaHH, just a different wording or thought process may help to understand. Also, seeing pitfalls can help raise awareness.
    – Davidmh
    Commented Jun 3, 2014 at 10:25
67

You might see it the answer as telling the exact same as another, but others may not. The wording might be in a way that some people understand your answer better (or the other). Diversity not only in the presented content, but in the presentation itself is useful.

As such unless after you see another answer you think your answer is wrong (or in another unsalvagable way too bad), you should keep it. up/down votes will tell you how much the community agrees with your answer.

3
  • 16
    I agree. Many times, I have to read multiple answers to get the essence and extract the common useful part of code. Moreover, many-a-times, the better code turns out to be more difficult to deduce because my mind wanders off to learn about the unrelated stuff. So let your answer stay put. Commented May 26, 2014 at 10:08
  • 3
    I think this answer nails it head on. If presentation is different than the better answer, than that's a good enough reason to keep your answer.
    – gitsitgo
    Commented May 28, 2014 at 14:00
  • "Diversity not only in the presented content, but in the presentation itself is useful." Well said.
    – Maxpm
    Commented May 30, 2014 at 10:48
62

I would upvote the other answer; then improve my answer, trying to add anything that the other answer does not address. I would keep my answer in most cases.

2
  • 14
    yep
    – user2140173
    Commented May 26, 2014 at 9:47
  • 1
    It's worth it to keep an answer that is short and to the point vs an answer that is unnecessarily long as well.
    – C Bauer
    Commented May 28, 2014 at 13:30
27

I personally think that having 10s of almost identical answers to the same question adds no value and creates so much noise that it becomes difficult to extract the signal.

One side effect is that a late coming, superior, answer will probably get lost in the middle of the noise.

This site being community driven we all have our share of responsibility to keep it as clean as possible.

An example? This question asks "how can I concatenate two arrays in Java?". And it has 40 (forty!) answers. If you go through it you will see a lot of duplicate information. There may be 5 ways, but not forty. Somebody recently realised that the latest version of Java provides a nice one liner solution. Guess what? That answer is somewhere between the 25th and 30th answer although it does add valuable information (I'm sure that following my comment it will get upvoted* but you get my point).


To conclude, and as you have probably guessed, I would suggest that:

  • if your answer does not add anything, delete it
  • if there already is an answer that is 99% good, comment about the missing 1% instead of posting a whole new answer and/or edit that answer if appropriate. And if the answerer rolls your change back or does not react to your comment, post/leave your own answer.
  • if it is a community page, edit the answers that can be improved directly
  • otherwise, by all means, leave your answer

ps: I have to admit that when I first started answering on SO I would not follow those rules because of the rep loss associated with deletion. I don't really care about rep any more so it has become easier to "do the right thing".

* that was a good guess: it is now #7!

15
  • But If my question is marginally better than the other, should not the other user delete his answer instead of me?
    – jspurim
    Commented May 26, 2014 at 12:11
  • That in the case we posted the answers at about the same time. I understand it's better to add a comment instead of posting an almost equal answer to an existing one.
    – jspurim
    Commented May 26, 2014 at 12:13
  • 2
    @jspurim Yes that's what I meant. If an answer is already there that is 99% good, just comment on the 1% instead of posting a whole new answer that will be almost identical. If you posted at the same time then it's probably the other user who should delete his/her answer.
    – assylias
    Commented May 26, 2014 at 12:14
  • 1
    I have clarified that
    – assylias
    Commented May 26, 2014 at 12:17
  • 2
    Why comment instead of editing in the change?
    – StockB
    Commented May 26, 2014 at 16:33
  • 2
    Stock - couldn't agree more. I am really getting angry at resistance to editing on QA boards. It's nuts.
    – Fattie
    Commented May 27, 2014 at 7:43
  • 2
    @assy ... "creates so much noise that it becomes difficult to extract the signal" Totally disagree. You couldn't be more wrong. Humans are unbelievably good at sifting through information, particularly written information. It's 100% trivially nothing to glance through 10, 20 even 100 short written informational items and grasp what is going on. This is a well understood aspect of human cognition. Your comment would be not unlike saying "Humans / other hunting animals find it difficult to recognise motion in their field of vision" which is of course the opposite of the truth.
    – Fattie
    Commented May 27, 2014 at 7:45
  • @StockB if your edit is reviewed it would probably be rejected as "radical change". But editing directly is definitely an option and you can leave a comment to the other user explaining what you have done.
    – assylias
    Commented May 27, 2014 at 8:30
  • 1
    @JoeBlow yes and no. Of course we are good at skipping what is not relevant to us but it takes time. The more noise there is, the more time it takes.
    – assylias
    Commented May 27, 2014 at 8:32
  • Having dozens of answers may be bad, but the OP is specifically asking about the situation where after posting an answer (assuming a situation where this is good, possibly when none or only a suboptimal is present) he realizes that at the same time someone else was posting a similar answer. And if you look closely at questions with so many answers, often they accumulated over quite a time, late answers mostly by lower rep users, so the underlying problem with those is a totally different than the decision the OP tries to get advice on.
    – PlasmaHH
    Commented May 27, 2014 at 8:40
  • Hey @assylias !! Not true. When you say "takes time", you are talking only 100s of milliseconds - check out some studies. (Or just observe yourself doing it.)
    – Fattie
    Commented May 27, 2014 at 9:31
  • 1
    Hi Plas .. the fundamental problem is the (bizarre) resistance to editing. As in my example (see comments at top). Very often, BEYOND ALL BELIEF, you see this in comments: person A answers, good answer. person B says "dude, that's a great answer, but this detail _ _ _ is utterly incorrect." then amazingly person A will comment: "Doh, you're right, _ _ _ is utterly incorrect, it should be _ _ _!" BUT PERSON A DOES NOT CLICK THE BUTTON TO EDIT THE POST. it's just ....... beyond ridiculous. Utterly bizarre. It's the resistance to editing phenomenon on QA sites. bizarre.
    – Fattie
    Commented May 27, 2014 at 9:34
  • 1
    @Joe Blow. Here is an answer where I did what you just comment. My reasoning at the time was not to edit because an aswer using iteritems was already posted, and I thought leaving my answer too would help others to understand the difference. I sometimes find suboptimal answers quite useful for understanding why another answer is better. What do you think of it?
    – jspurim
    Commented May 27, 2014 at 15:28
  • 1
    @JoeBlow is right that this doesn't make noise/signal worse. If anything it is more reassuring to see the same or similar answers several times, and lets one see exactly what is the key info and what is the syntactic or stylistic fluff.
    – jwg
    Commented May 27, 2014 at 16:14
  • 1
    "I sometimes find suboptimal answers quite useful for understanding why another answer is better." YOU ARE NOW A LEADING PHILOSOPHICAL THINKER OF THE COMMUNITY! That is beautifully expressed, @jspurim. Thank you! "I sometimes find suboptimal answers quite useful for understanding why another answer is better." Now that's the truth.
    – Fattie
    Commented May 28, 2014 at 4:38
2

Here's a more detailed answer but I'm not editing my other one that sums things up pretty well.

1. I would leave my answer be if it's correct, even if it's not the best. Anyone seeing the question and the answers could compare them and learn the differences. Or they could come up with a better solution from comparing the two answers. It's easier to see an improvement when comparing with a lesser solution.

2. I usually vote multiple answers if they're good enough. I've got votes to go around. I often vote multiple answers if they complement each other or I consider all of them correct. You can only choose one Answer for a question but nobody is preventing you from up-voting two. So be generous with all those who are correct. Sometimes the real answer is the sum of several different answers available on a question. But this only applies if the one reading the answer gets it. I often post answers that they don't get...

3. Worst case, delete it. If the difference between the answers is minimal and you didn't post it first, remove it. Even if you started writing it first, you'll look like a plagiary. :)

4. As I said before, keep calm and learn from the better one. The rest is just bureaucracy. Don't let it be in your way to contributing and learning. And ignore the haters. If you answer gets smacked for not adhering to the most pristine of time wasting standards that are all the rage today (probably not tomorrow), let it be if it's correct. We ain't all unit-testing micro-managing fanatics. It'll eventually recover once enough clear eyes and calm minds see and up-vote it.

PS: I use statics in PHP where they should be used. It gives OOP fanatics and unit-testers a fit but I don't give a (rhyme).

</rant>

1

If your answer does not add anything and there's already many similar answers, I think the best thing to do is just delete it and upvote one of the better answers.

On the other hand, it is useful sometimes to have several equivalent answers that just differ in their formulation. I sometimes found among many answers that special wording that made the issue completely clear to me.

I also agree with the comment "I sometimes find suboptimal answers quite useful for understanding why another answer is better." Indeed. That occurred to me, too.

So, I would delete my answer only if I think it really adds no value at all.

0

I would upvote the other answer, but would also edit mine to add the etra info that the other answer has with a "As @OtherPersons answer states......"

I would also add a comment to the other answer, stating that the OP should consider accepting it over mine

2
  • 1
    Why keep two answers around that say the same thing?
    – Cody Gray Mod
    Commented May 28, 2014 at 13:38
  • 2
    The idea is that my answer is chosen, the other is not, hence it is down in between other answers. Most people often view only the answer that is chosen. See the edit Commented May 28, 2014 at 13:40
0

4. KEEP CALM AND LEARN FROM THE BETTER ANSWER!

1
  • 2
    But how to do that is the question :-)
    – Nishant
    Commented May 28, 2014 at 19:15
0

Let democracy decide which answer is better.

Its not dishonest to have similar answer to someone else. Its not a competition. Who knows, maybe yours is better because it lacks that modularity or optimization. Time and upvotes will tell.

2
  • "Its not a competition" Sure it is! That's what all these imaginary points are for!
    – Kevin B
    Commented May 30, 2014 at 19:00
  • @KevinB Looks like you may be right. I appear to have drawn someone's ire -- :)
    – nsfyn55
    Commented Jun 1, 2014 at 12:41

You must log in to answer this question.

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