44

I am just curious on what the etiquette is on editing answers. I just had an (old) answer edited because the editor disagreed with my choice of code. Not a grammatical error or wrong link, but some working code.

While I agree that the edit is correct and probably better, it is a choice. Shouldn't this edit rather have been a comment to encourage discussion?

Here is the edit in question: https://stackoverflow.com/posts/19457703/revisions

14
  • 4
    It is definitely an improvement. Why would you want to "discuss" it, especially since you agree that it is correct? There's nothing to discuss. Commented Jun 11, 2015 at 16:50
  • 2
    @HansPassant - I guess that is what I try to ask here. Is "an improvement" worth an edit or are edits supposed to correct factually wrong/broken code? I feel a user might learn more from a comment that suggests a better way of doing things, especially when the OP agrees with it.
    – Steve
    Commented Jun 11, 2015 at 17:00
  • 7
    SO users edit to improve posts. It is an improvement. If you hate it anyway then you can roll it back. Commented Jun 11, 2015 at 17:06
  • 28
    To me, the issue is not that they edited an answer, but that they edited code., Code edits are (and should be) held to a higher standard than text edits, since code actually does things. Commented Jun 11, 2015 at 22:45
  • 1
    If you feel both versions of the code have merit, you can always show both of them and explain in what cases you'd prefer one or the other. Commented Jun 11, 2015 at 23:07
  • Clarifying meaning good, changing meaning bad.
    – Sobrique
    Commented Jun 12, 2015 at 14:51
  • 10
    @HansPassant - disagree. The code is the answer and the answer is what the answer is. If someone wants a different answer they should submit their own. Commented Jun 12, 2015 at 15:02
  • 1
    That can't work, rampant accusations of plagiarism. Commented Jun 12, 2015 at 15:15
  • 18
    -1, missed an opportunity to use the word EDITquitte.
    – corsiKa
    Commented Jun 12, 2015 at 17:40
  • @HansPassant I thought that provided you reference the other answer saying it is just an improvement, it was correct to give a new one with an edit of its code. Commented Jun 12, 2015 at 17:42
  • 4
    @GrantWinney Thanks...I'll be singing that in my head the rest of the day.
    – That1Guy
    Commented Jun 12, 2015 at 18:34
  • If that edit were in the review queue, I would reject for the reason "attempt to reply". Commented Jun 14, 2015 at 4:14
  • @BobJarvis are we really suggesting that someone posts an entirely new answer just to change subtle things like whether we're showing output in the console or annoying popup?
    – user562566
    Commented Jun 14, 2015 at 5:05
  • @TechnikEmpire - I'm saying that changes such as those you suggest are sufficiently trivial as to be worthy of a rollback. If the "change" is not sufficiently trivial then it should be posted as an answer in its own right, and therefore because the change is non-trivial and thus changes the author's intent it should be rolled back. So I'm at the point where "changes to code which are more than formatting changes are open to being rolled back at author's whim". YMMV. Commented Jun 15, 2015 at 1:48

2 Answers 2

81

Given that this particular change is purely based on personal preference, the edit was indeed inappropriate.

The fact that they don't like they way you choose to implement the solution doesn't make it okay for them to edit your answer.

2
  • OK, that's what I though... I will keep the answer as it was edited, as, after review, it is certainly the cleaner way. But this leaves this exchange solely between the editor and me and the users reading the answer will be left out.
    – Steve
    Commented Jun 11, 2015 at 16:29
  • 8
    @Steve Not sure why other members need be involved in that exchange. If you want them to consider the before and after, show them the before as a code comment ... or something.
    – HansUp
    Commented Jun 11, 2015 at 20:45
15

It's a petty change that really doesn't do anything. It could have just been // log it for all we care. The message hasn't changed.

Posting a comment would be more appropriate. Though in this case it might be so trivial it's not be worth it.

0

You must log in to answer this question.

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