Possible Duplicate:
Which solution is better? Edit old answer or add new one?

I found some code in an answer and improved upon that code. I fixed some performance issues and also added functionality.

Should I edit the answer where I found the code and put in my code, and possibly also leave a comment on that answer indicating my edits, or should I add a new answer.

  • not duplicate. in that case he was asking if he could edit his own question – mkoryak Aug 31 '12 at 15:52

If you're going to make non-trivial changes to someone else's code you really shouldn't edit their answer. If they just left off a parenthesis or semicolon then feel free to edit it in, but if you're going to re-structure it, change the coding style, or "improve" it in any way that you feel is meaningful, (and the post isn't already community wiki) then an edit would be in appropriate. If you just want to point out that something won't work, or that it could be improved, then a comment would be fine. If the changes are significant enough that it couldn't reasonably fit into a comment, then chances are it's significant enough that you should be posting another answer. Make sure that if you're posting an answer that's based on someone else's code you link to that answer and attribute the original author as appropriate.


If the answer is completely different. aka new code added etc. Make a new answer.

Otherwise -- edit away!

  • its more than 50% different, but less than 75% ;) – mkoryak Aug 31 '12 at 15:52

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