What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 128 Stack Exchange communities.

I came across this suggested edit today. The only edit was to change variable names in the code sample. (probably to make the code sample easier to read) The rest of the question was unedited.

Is this acceptable? It sure doesn't seem right to me at all.

enter image description here

Permalink to the edit in question

share|improve this question
2  
After seeing ChrisF's reply, I re-read this question and realized - you think this edit was made to a question! That doesn't really change my answer, but it does make me wonder if the review page needs to make this a bit more obvious (right now, the only major distinction is "answered" vs "asked" next to the original author's name). –  Shog9 Nov 22 '11 at 0:01

4 Answers 4

up vote 11 down vote accepted

When in doubt, read the edit in the context of the question!

Note how the asker edited her question shortly after asking it, shortening all those long class and variable names down to things like "abc" and "ABC"?

The suggested edit did the same thing to the answer. So far as I can tell, it was a perfectly appropriate edit, preserving the intent of the answerer while removing the confusion introduced by the edit to the question.

On a more general note, there's nothing inherently wrong with editing code to make it easier to read (whether by reformatting whitespace, adding comments, or simply renaming variables). When evaluating an edit, try to determine if it actually improves the post - don't look for hard and fast rules by which you can accept or reject without thought.

share|improve this answer

As implied by Shog9's answer, I allow these edits when made by the OP to the accepted answer.

In fact, I usually "Improve" the edit, as this automatically "Accepts" the OP's changes. Otherwise, they are usually rejected by people who don't check the whole question-context.

share|improve this answer

Changing variable names in code could substantially improve the question/answer by making the code much easier to understand.

Every case needs to be evaluated on its own merits, and I have no opinion on the case you cite, but in general, I believe that renaming variables can constitute a legitimate, constructive edit.

share|improve this answer

Always take care with editing code in questions. It's all too easy to correct the mistake that's the cause of the problem.

In the context of this question it might be that the OP has reused a variable incorrectly, or mistyped it a second time for example.

In these cases reject the edit and leave a comment for the OP asking if the error is just a typo in the question.

share|improve this answer
3  
In this particular case, the edit was made by the asker to an answer (a fact I now realize was missed by the OP here as well... Perhaps the suggested edits page does not do well at distinguishing between questions and answers?) after making a corresponding edit to the question itself. –  Shog9 Nov 21 '11 at 23:53
    
@Shog9 - I realise that and perhaps should have made it clearer that I was addressing a slightly tangential issue. –  ChrisF Nov 22 '11 at 9:13

You must log in to answer this question.

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