8

In another Meta discussion about suggested edits, Mokubai♦ posted the following:

With code related edits if I do not know what the edit is doing or if it changes the output of the code in question, as it would appear to in your case, then I would rather see it rejected and the editor post their own answer.

Do we have an official policy on edits to code? If not, can we adopt one? I'd suggest that no edits to code should take place, except from the author. If code is wrong, users should post in comments and use down votes. If code is dangerous, then flag as Offensive or something similar, with a comment.

On the other hand, how many coding questions come up? Is this worthwhile setting in stone, one way or the other? If we have syntax highlighting on code blocks, I'd accept that as a valid edit (as long as other items in a post were updated as well).

6
  • I should mention that there is a special notification "code edited on [question|answer]" that appears when code is edited in addition to ant other edits made to the question. On the other hand, when code is not edited, it will merely say "[question|answer] edited".
    – gparyani
    Commented Aug 13, 2014 at 17:25
  • 3
    I think that's to be decided on a case-by-case basis. I'd have no issue with someone fixing a few Bash scripts when they're adding double quotes around variables etc. Most of our visitors are anonymous, don't have comment or downvote rights, and if they can improve and fix something (as long as it's not too radical), why not?
    – slhck Mod
    Commented Aug 13, 2014 at 18:44
  • 1
    @slhck Everything is a case-by-case, but your thought of something helpful might not be the same for another person. I've seen "innocent" scripts that could easily wipe important data from a hard drive, and I've seen scripts that don't do anything. Should it be our responsibility to test each script, and re-write as necessary? Commented Aug 13, 2014 at 18:50
  • Well, if we decided on a no-code-editing policy, how would we enforce it? We'd have to block these edits, otherwise we wouldn't be able to reach all reviewers. That's why I'd rather stick to what we're doing now: having users review these edits and skip them if unsure. I'm just not sure whether we even have a big issue with code edits (unlike Stack Overflow).
    – slhck Mod
    Commented Aug 13, 2014 at 19:20
  • @slhck Acceptable... How about posting that as an answer, and if other people have feelings one way or the other, they can post an answer too? Commented Aug 13, 2014 at 19:28
  • Many folks don't format their code properly and don't honor site policy on whitespace, so cases exist where someone touching up a question would violate the new policy. In addition, I often delete those auto-generated comments. I'm not sure how to reconcile the issues.
    – jww
    Commented Aug 18, 2014 at 8:14

3 Answers 3

7

My take on this… if we were to decide on a policy that'd discourage users from editing only code (anonymous and registered users alike), we'd have a hard time enforcing it. It'd either require the developers to implement a filter that rejects such edits immediately, or we'd have to find a way to tell all reviewers.

Also, we've learned that quite a few reviewers aren't even doing their job properly when there's plenty of guidance around.

Consider that we don't have as much code around as other sites, so I don't even see an issue to begin with. Granted, I haven't reviewed suggested edits in a while, but I've rarely come across code-only edits before, and when I saw them, they mostly did a good job at explaining what didn't work and what they fixed—even from anonymous users!

We certainly don't want to discourage users from fixing wrong content when they see it. If you put yourself in the position of someone looking for help, finding a good (but semi-working) piece of code on this site, getting it to work, and then not being able to fix it for others… wouldn't be that nice.

Maybe the policy could be: As long as you explain what it does, and it does not radically change the meaning or intention of the post, then it's fine. And that applies to any edit, if you think about it.

3
  • This fits quite well with my preference. If the edit is not clear, does not explain the changes, changes the meaning or end result then it should be rejected. Keep the improvements, reject the radical changes. Pretty much business as usual if you play properly in the suggested edit queue.
    – Mokubai Mod
    Commented Aug 13, 2014 at 21:48
  • question is how to discourage bad reviewers? I have an edit that almost completely removes my answer and changes it to something different. See meta.superuser.com/questions/8343/… Commented Aug 18, 2014 at 6:42
  • @akostadinov Well, we have edit audits, but they can only do so much. I don't know how we can improve that, other than requiring more reviews per suggested edit.
    – slhck Mod
    Commented Aug 18, 2014 at 7:04
10

If you set up a policy, that isn't going to stop this from happening; it's just going to give folks a stick to beat people with in cases that aren't problematic.

An edit that breaks code is bad. So is an edit that breaks prose. So "don't break stuff" is a pretty good rule to have when evaluating edits. "Don't edit code" isn't.

1

I've a question that was edited IMO in an inappropriate way almost completely removing my original answer meaning.

Can we report unreasonable edits?

I'm proposing that one can flag reviewers for not following guidelines. When some number of people do that, the reviewer is banned from reviewing for some time.

3
  • You can already flag the post when you see something like that. This always needs manual review anyway, and the mods could ban bad reviewers.
    – slhck Mod
    Commented Aug 18, 2014 at 17:40
  • Sorry, you mean to flag my answer? I think this might help if reviewers are with bad intentions. But in case they don't know or are negligent, then it is of not great help IMO. Commented Aug 19, 2014 at 13:57
  • Yes, I meant flagging your own answer.
    – slhck Mod
    Commented Aug 19, 2014 at 17:03

You must log in to answer this question.

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