Here is the history of my suggested edit of one of the answers to this question.

But I don't understand, why was this suggested edit rejected by the community?

  • 14
    Given that this looks like you're fixing a mistake in code it might be more appropriate to comment on the question and see what the OP thinks.
    – Flexo
    Commented Aug 3, 2012 at 9:35
  • 5
    It's one of those things where, even if you're right, people tend to be cautious, preferring for you to leave a comment.
    – Bart
    Commented Aug 3, 2012 at 9:37
  • 1
    (The reason being that the OP may have meant to override a different method that should return a boolean or use some other code instead)
    – Flexo
    Commented Aug 3, 2012 at 9:38

3 Answers 3


I'll usually reject suggested edits that change code unless there's a good reason not to. It's very easy to change the meaning of an answer unintentionally with even small code changes.

The only reason I approved your suggested edit was because:

  • The change was trivial and unlikely to introduce an error (removal of an entire return statement).
  • There was supporting evidence in the accepted answer on the question that the post you edited had meant to override a void function.

Often when people are reviewing edits, they don't have any context other than what is in your comments on the edit. I believe yours were something like "void functions can't return a value". Without context, it's hard to know if the overridden function (OnBackPressed) should have been declared as void or bool.

You may have had similar changes accepted in the past however because some people are significantly more likely to approve an edit than reject one, so there's also an element of luck/timing involved...

  • 5
    @prizoff Slightly OT: with respect to the first suggested edit linked by forsvarir, please make sure you fix all issues in a post while you're at it. Not just the code. The bold formatting is unnecessary, as is the "Thanks" message at the end. I might have rejected your suggestion as "too minor" if I'm particularly grumpy.
    – Bart
    Commented Aug 3, 2012 at 10:20
  • 2
    There's no particular reason to reject edits to answers just because they change code. This case was evidently a good edit and you were correct to accept it. Please do not give the impression that such edits are unwelcome. Commented Aug 31, 2013 at 14:48
  • "Often when people are reviewing edits, they don't have any context other than what is in your comments on the edit." - then why on earth they have rights to make decisions? Those suggested edits approval/rejects are just random in such cases. Commented Oct 10, 2017 at 23:22

If you look at the "how to edit" block shown when you suggest an edit, you will notice it shows the following points:

  • fix grammatical or spelling errors
  • clarify meaning without changing it
  • correct minor mistakes
  • add related resources or links
  • always respect the original author

None of those points is about code, but somebody could argue that changing the code you are changing the answer given from somebody else.

I would generally suggest to avoid editing the code given in a post. If there is a typo in the code, I would write a comment letting the user who wrote the post know that; if the answer is suggesting using a function, and I believe there is a better function to use, I would write a comment about that.

In the case you think the code is completely wrong, or there is alternative that could be used, then you should write your own answer, rather than editing the answer given from somebody else.

  • 2
    If you look at the “how to edit” block that you helpfully quoted, you'll notice that it includes “correct minor mistakes” and “respect the original author”. This was a correction of a minor mistake and it respected the original author (who went and made the exact same change after he became aware of the problem). There is no reason not to correct mistakes in code. A comment would have been the wrong thing in this case: comments are only for unresolved issues. Commented Aug 31, 2013 at 14:50

This is very clearly a good edit that should have been accepted. I'm sorry for the reaction you got.

This is a textbook case of a good edit:

  • It fixes a small mistake in an otherwise good answer.
  • The edit summary explains the mistake.
  • The mistake is easy to verify: indeed, return true cannot work for a method whose return type is void, and anyone who is familiar with a large number of C-like languages (C, C++, Java, C#, etc.) can spot that.

The rules for editing state this clearly:

When should I edit posts? (…)

  • To clarify the meaning of the post (without changing that meaning)
  • To correct minor mistakes

This is a minor mistake being corrected. The meaning of the post isn't changed: it's just a code example that was made correct. The original author was respected: after you pointed out the problem to him in a comment, he went and made the exact same change.

I'm sorry that your valuable contribution was rejected. Sadly, this is an old problem on Stack Overflow — reviewers who reject edits in direct contradiction with the rules and core values of Stack Overflow. Please keep up the good work nonetheless.

  • 1
    It can't be verified that easily: It'd possible that the function should return bool and the return statement was correct, or that it should return void and the return statement was incorrect. While one can verify that void is correct using the documentation, that's not generally expected of reviewers. Commented Aug 31, 2013 at 15:42
  • 5
    @cod It can be verified easily, and that very much is expected of reviewers. We should not leave obviously broken code lying around. If it's fundamentally broken, downvote. If it's mostly correct, edit. Commented Aug 31, 2013 at 16:17
  • 3
    If a reviewer is incapable of verifying the correctness of an edit (or simply unwilling to take the time to do so), he should skip it, not reject it. Commented Aug 31, 2013 at 20:04
  • 1
    More than a year late answer :) Nice to see. I even do not know, maybe I should accept it as correct?
    – Prizoff
    Commented Sep 1, 2013 at 6:45

You must log in to answer this question.

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