3

I just saw a (very...) common question on SO, so I copied an answer from the PHP documentation with link.

Trouble is, I misremembered what the example did (remove excess whitespace vs. removing all whitespace as the poster had requested), and didn't notice this until a couple of commenters went, "Hey! WTF!" There's a moral in here somewhere about the dangers of copy+paste.

Is it appropriate in this situation to edit the answer with a remark to this effect? I don't want the incorrect version floating around there to mislead people who don't look at it too closely, but it also seems kind of... I dunno... unfair to the commenters (because I can just picture future commenters saying, "You guys are wrong! It clearly removes all whitespace!").

1
  • 2
    Just a side note: 'Common' questions (means it was asked repeatedly) should be marked as duplicates instead of being answered. Commented Jul 15, 2010 at 7:08

2 Answers 2

10

What I tend to do in this situation is either:

  • Delete the answer (if its really really wrong, and someone else has posted the correct answer already)
  • Edit the answer to be correct, and post a comment along the lines of "I've fixed it now..."
0

Actually, it's kind of fun getting all those commenters frowned upon. :)

No, but seriously, there will be a "edited on " at the bottom of the answer, so it'll be easy to tell that it must have been edited before. Only the new users would probably think otherwise.

Whenever a comment is there which points to a mistake which doesn't exist anymore, I assume that it had been there before, and it was then corrected.

If you're not as evil as I am, though, you could do what @Kragen suggested earlier.

You must log in to answer this question.

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