10

While doing edit reviews, I have often noticed that invalid edits to code are approved.

Point in case; this edit introduces two syntax errors, yet, it was approved. Only I rejected it based on being invalid, three others accepted it, and someone else rejected it based on being too minor (!!)

This is far from uncommon and happens several times a day. Other sorts of invalid edits I've encountered are:

  • Changes to code style/indentation which don't objectively make the post better
  • Fixes to syntax errors/logic errors (often, this is the precise problem the OP is having).
  • Fixes typo/capitalization
  • Other edits which change the actual meaning of the code...

When should I make edits to code? clearly states the do's & don't, but not all (new) users are aware of this, and make well-intentioned but invalid edits. I've developed some sort of sense to detect which sort (invalid) edits are likely to be approved anyway, and I go back & rollback the changes, but this is a "hack", and overrides the point of the review process.
Also makes you wonder how many of these invalid edits slip through...

Should the edit page make it clearer that edits to code should fix only very specific problems?

For editors, an extra line could be added, perhaps only for the first n edits, ugly mockup: enter image description here

Or, an extra confirmation box could be down when changes to a code block are detected, another ugly mockup: enter image description here

For reviewers, an extra line could also be added: enter image description here

7
  • Due to the special rules I would suggest that suggestions are disallowed on code blocks. It's easier that way, and the amount of beneficial code changes that are made via suggestion by lower rep users would be absolutely minimal. We honestly don't need to formatting "fixed" by people who are not experienced at edits.
    – slugster
    Jul 18, 2014 at 14:17
  • Those "special rules" are just common sense indicating that code is especially sensitive to editing, and that any edit must be objectively better, not just change fr the sake of change or dogma. Jul 18, 2014 at 14:18
  • 7
    @slugster That has some pretty noticeable side effects though. For example, if someone put their entire post in code blocks just because or used code blocks for emphasis a suggested edit couldn't fix it.
    – Servy
    Jul 18, 2014 at 14:21
  • 3
    +1, The first and third ugly mocks are good suggestions, as they would provide a just-in-time reminder to the editor and the reviewers. Jul 18, 2014 at 14:32
  • @Servy I agree, but those would be few and far between, and most likely spotted pretty quickly by someone with full edit privileges.
    – slugster
    Jul 19, 2014 at 0:40
  • @slugster Also, formatting code blocks can often be considered beneficial - sometimes code can be really messy in posts and I often find myself formatting those code blocks, especially if it does make things easier to read. Dec 12, 2017 at 21:40
  • The "I confirm that my edits comply" button suggestion gets my blood pressure up. I generally like the ideas proposed here but let's not make it look like a legal shrink-wrap agreement.
    – tripleee
    Dec 13, 2017 at 5:02

0

You must log in to answer this question.

Browse other questions tagged .