15

I just came across this edit suggestion: https://stackoverflow.com/review/suggested-edits/20137246

I skipped it, because I wasn't sure about it. But I'm curious what would have been the right way to handle it without skipping.

It looks to me like it is a thorough improvement but I'm not enough of a Python expert to be absolutely sure. But leaving that aside, even if I assume that the edits are 100% correct, I would not be sure how to handle it.

Under the assumption that the result of edits is a completely correct answer, should it be approved or should it be rejected because it deviates from the original too much and should therefore have been contributed as a separate answer instead of as an edit?

The explanatory text for the "conflicts with author's intent" rejection reason says that:

Even edits that must make drastic changes should strive to preserve the goals of the post's owner.

Is the linked edit preserving the author's intent?

And to generalize the question: are their any hard criteria for when an edit crosses the line to not preserving the goals of the post's owner any more or do I just have to accept that there will always be some degree of squishiness involved here?

Addition:

As pointed out in the comments, the linked edit suggestion is actually for a question and not an answer, so for the concrete case my question here is kind of pointless. But the generalization of the question remains valid, I hope.

9
  • 1
    "Under the assumption that the result of edits is a completely correct answer" -> Your example is an edit on a question, not an answer. Jun 27, 2018 at 9:37
  • Either a question or an answer, very little of the original meaning survives, doesn't it? The code is changed, the linked reference is changed...
    – yivi
    Jun 27, 2018 at 9:39
  • Right, I overlooked that! I guess in that case, the edit doesn't make much sense... @AndréKool Jun 27, 2018 at 9:39
  • Yeah, but that's exactly what I'm not sure about, in case of an answer. Does an edit have to preserve the complete meaning, so is it always to be rejected if it doesn't, even if it clearly improves the quality of the answer? @yivi Jun 27, 2018 at 9:43
  • 5
    Notwithstanding the suggested edit "improving" anything, if the original meaning is lost or changed, I would reject. We have reject reasons covering those scenarios. "Attempt to reply" comes to mind.
    – yivi
    Jun 27, 2018 at 9:44
  • 1
    Related: meta.stackoverflow.com/questions/260245/…
    – Jesse
    Jun 28, 2018 at 13:42
  • 1
    Almost any edit to Python question code should be rejected, unless it's simply putting the code into a code block, or it's done in consultation with the OP because they haven't figured out how to use the SO editor. Even fixing indentation (without the OP's consent) should be rejected because Python indentation is syntactically significant, so fixing the indentation may edit the problem out of existence, or turn it into a different problem.
    – PM 2Ring
    Jun 29, 2018 at 17:50
  • OTOH, I sometimes repair "flattened" Python indentation in very simple programs if it's obvious from the error traceback &/or the OP's problem description that the code on their machine is correctly indented, but even then I urge the OP to verify that my version matches what's on their machine.
    – PM 2Ring
    Jun 29, 2018 at 17:50
  • If someone changes the code and you don't understand how it is improvement, reject. If the comment has a valid-sounding reason or the edit adds more code it's "attempt to reply", if it just removes or changes code it's "conflicts with author's intent". If only variable names are changed, might be "no improvement whatsoever". There are valid reasons to edit code (for example reverting a previous edit that broke the code), but then the editor should make that clear in their comment.
    – VLL
    Jun 29, 2018 at 18:04

1 Answer 1

18

The biggest tell that this was a bad edit was that the editor elected to add new code in. Especially because this is a question, adding any new code at all to the question runs the very real risk of invalidating existing answers or confusing onlookers, which...it actually did.

The editor assumed Python 3 (and don't get me started on Python 2 vs Python 3 right now), but the question really was meant for Python 2, which uses print as a keyword and not as a function call.

Even if you don't know a language, knowing that there's new code being introduced should warrant a rejection of the edit unless in the comment for the edit, they provide the necessary context as to why they did it (such as a direct link to the OP's own code buried somehow in comments).

3
  • Yes, but in case of an answer it can sometimes be a little bit more tricky to draw the line between valid improvement and alteration that should have been contributed as a separate answer instead of an edit, doesn't it? Jun 28, 2018 at 16:02
  • 2
    Not really; if someone's edit adds new code it should be a different answer, so the edit in most cases should be rejected. Editing code is a very tricky thing.
    – Makoto
    Jun 28, 2018 at 16:04
  • Alright, I'll keep that in mind as a guideline, thanks! Jun 28, 2018 at 16:05

You must log in to answer this question.

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