3

Quite often, I'll see edits that correct the code in a question, e.g. https://stackoverflow.com/review/suggested-edits/10805625

While the correction may be right, the original incorrect code may be what's causing the problem that caused the OP to ask the question in the first place.

Is it worth having a Reject Edit option of

Corrections to code in questions should be addressed via comments, as incorrect code may be the cause of the OP's issue

or something along those lines?

2
  • 1
    Your title says "Correcting code in answers" and your question asks about "edits that correct the code in a question". Please clarify and fix either the title or your question. Jan 7, 2016 at 12:01
  • @DavidPostill So it does. Fixed now. Jan 7, 2016 at 14:41

2 Answers 2

1

This specific edit you're referring is a valid edit. The editor simply removed the auto generated "`enter code here`" message, so it should be approved.

In case where the edit attempts to fix an error in the code itself, then it should be rejected and we already have a descriptive option for that:

clearly conflicts with author's intent

This edit deviates from the original intent of the post. Even edits that must make drastic changes should strive to preserve the goals of the post's owner.

1
  • 1
    And even in that case, it should only be rejected if it corrects the error leading to the question. If in any doubt, skip. (As an aside, that often signals it should be closed as "typo".) Jan 7, 2016 at 10:00
3

Like Maroun Maroun says, that specific edit clearly only corrects an input-error the user had on SO, thus bringing the post nearer to what he intended.
It should be approved.

Anyway, even code-edits fixing errors the OP had should be approved, as long as it is clear that the fix does not invalidate the question or mis-represent the authors intent.
If in doubt, skip. There is no shame in using "Skip"

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