Looking through the suggested edits queue, I've come across many suggestions that change code blocks. I've found myself rejecting most of them. In many (most, if not all) of these, the edits make big changes that fix substantial bugs (either compile- or runtime) in the code in question. I feel like these sorts of edits should be suggested in comments, since they might alter the meaning of code (even if the original code wouldn't compile) in such a way that the question might lose meaning.
Am I right to reject these changes? I didn't doubt myself at first, but as I see more and more of these I thought it was worth confirming the expected behavior for reviewers.
There are two particular cases where I'm curious, and I realize that the answers might not be congruent:
- When should changes in question code be accepted or rejected?
- When should changes in answer code be accepted or rejected?
This is a good example of an answer of an answer. I see this particular edit has been rejected on the grounds that it is a failed attempt to comment, which I definitely agree with, but it illustrates the point.
There have been other examples I've seen wherein people suggested adding a semicolon, or other minor typographical fixes. I tend to feel the same way about these edits, since semicolons do alter the meaning of code, even if (or especially since) it wouldn't compile without them.
On the other hand, there are other cases where huge bugs are fixed, which one could argue might even be answer-worthy.
So where should one draw the line? Should all code edits be rejected? That seems a little extreme, but it feels weird letting them through, even in small cases. I certainly don't mind suggesting these edits be placed in comments.