I've seen a couple of edits that add a description to a code only answer. Should we reject or approve them?

They are commonly rejected as "Invalid Edit" or "Too Minor," but it isn't either of those. It's a valid edit (i.e. not really a comment), and it isn't minor as a code only answer has nothing to edit.

So, what? If we should accept them, should we add them to the audit?

  • 5
    It looks OK to me, assuming you can more or less determine that the comment is actually useful. – user102937 Feb 12 '13 at 15:11
  • @RobertHarvey and if not, do we reject as vandalism? – Cole Johnson Feb 12 '13 at 15:12
  • @RobertHarvey Isn't the idea of reviews that they shouldn't need to be judged on their content; you shouldn't need knowledge of the tag to determine if it should be approved/rejected. – Servy Feb 12 '13 at 15:15
  • 3
    @Servy: It's not a high bar, but there is a bar. You wouldn't approve "I like turtles" or opinions about the code's style, for example. You wouldn't approve the obvious things, like "this code worked/didn't work for me." – user102937 Feb 12 '13 at 15:16
  • @RobertHarvey Sure, I get that, but determining if a paragraph description of code that previously had no description is a lot more complex than determining if "I like turtles" is appropriate in context, especially in the general case. – Servy Feb 12 '13 at 15:18
  • @Servy sometimes you need knowledge of the tag to determine if the suggested edit is factual. Even on examples other than the one given here (adding description to code). I don't really see any way around that given the nature of the site. – FoamyGuy Feb 12 '13 at 15:18
  • 1
    @Servy: Put it this way: I have no idea if the description is actually accurate, but I do know that the editor is making a good-faith attempt to clarify the code, which adds value to the post. – user102937 Feb 12 '13 at 15:19
  • @Tim Not if you assume that suggested edits shouldn't be there to change the content of the post, but simply to improve non-content aspects of the post (except of course of community wiki posts, in which edits for content would be acceptable). – Servy Feb 12 '13 at 15:19
  • @RobertHarvey Unless it's wrong, or misleading, or controversial, or not representative of the original author's views/opinions/intentions, in which case it removes value from the post. – Servy Feb 12 '13 at 15:19
  • 2
    It's a collaborative editing environment, people should expect their posts to be edited. If, however, you wouldn't make the edit yourself, and you're uncomfortable allowing someone without editing privileges making the edit, I wouldn't stand in the way of your decline. Remember, it takes multiple review votes on SO to accept or decline an edit, and the OP always has the ability to revert. – user102937 Feb 12 '13 at 15:23
  • @Servy stating how the code works is not opinion... – Cole Johnson Feb 12 '13 at 15:24
  • @Servy if an edit can add meaningful and relevant content to a post then I am all for it. I think it makes the site more useful. – FoamyGuy Feb 12 '13 at 15:26
  • @ColeJohnson Did you read the entire edit. It includes several very subjective statements that are clearly the opinion of the editor and not an objective analysis of just what the code is doing. – Servy Feb 12 '13 at 15:30
  • 4
    @RobertHarvey Making a "good-faith attempt" isn't good enough if you end up adding incorrect information into an answer (speaking generally, not about this specific example). If a reviewer isn't in a position to judge whether or not an edit is correct they should just skip it. Accepting or denying because you don't have the requisite knowledge just seems silly to me. – Anthony Grist Feb 12 '13 at 15:35
  • 1
    I think that the edit should be rolled back, but for different reasons. With code-only answers, the intent of the author is unknown. We should not make edits that change the intent of the post. I'd say that any description added to code-only answers should be rejected because of the ambiguity around the intent. – casperOne Feb 12 '13 at 16:12

An accurate edit that explains the code in a code-only answer is great! Why on earth would you want to reject it?

People come here seeking answers, and a block of code with no explanation is not usually a very good answer. Such answers can be greatly improved by adding a bit of text explaining what the block of code does, so if such an edit is suggested I would definitely approve it providing I am reasonably certain that it is accurate (if not, I'd leave it for someone else with knowledge of that tag to evaluate it).

From the page about the Editing Privilege:

When should I edit posts?

Any time you feel you can make the post better, and are inclined to do so. Editing is encouraged!

Some common reasons to edit are:

  • to fix grammatical or spelling mistakes
  • to clarify the meaning of a post without changing it
  • to correct minor mistakes or add addendums / updates as the post ages
  • to add related resources or hyperlinks

Edits like that improve our quality of answers, which makes Stack Overflow a better place.

Now as to your particular edit, it was probably done because there is a comment on the answer that said:

I appreciate that the Q asks for the shortest, but (for the benefit of anyone else) perhaps you could elaborate your answer to explain what's going on?

The OP of that answer hasn't been seen since June of last year, which was a few months before that comment was made, so some helpful person passing by probably thought they'd help future visitors by adding a description of what the code actually does.

I am disappointed that a moderator reverted the answer to remove the edit, as I think the edit made the answer much better, but I'm not about to get into an edit war over it.

  • "Why on earth would you want to reject it?" Because it belongs in either a comment or another answer. The purpose of edits is to improve a post without changing the underlying content, unless that post is wikied. – Servy Feb 12 '13 at 21:30
  • 3
    @Servy That edit does not change the underlying content. Furthermore, many edits that do change the underlying content of non-CW posts are appropriate, so long as they are within the scope of the post and don't change its basic meaning or cause it to say something the author doesn't want it to say. – Eliah Kagan Feb 12 '13 at 22:00
  • @EliahKagan That particular edit radically changes the content of the post. Minute changes to the content of a post, when it's because the intent of the author was different from what they wrote, would be okay. The perfect example of that is fixing a typo that changes code that won't compile to code that works fine. In this context, since the author said nothing we have no idea what their basic intent/meaning was, so judging if the description posted is in line with their intent is not possible, especially because it does more than explain what the code does. – Servy Feb 12 '13 at 22:04
  • 3
    @Servy please explain how it is a radical change? Unless I'm half blind or an idiot, that edit didn't change the code... – Cole Johnson Feb 12 '13 at 22:55
  • @ColeJohnson That assumes that the only important thing in the post is the code. That's a false assumption. An explanation of the code (mind you this text goes beyond just explaining what it does) is a very important part of a post. – Servy Feb 13 '13 at 15:09
  • 2
    @Servy but if there isn't one (i.e. just code), an addition is a good thing... – Cole Johnson Feb 13 '13 at 18:35
  • @ColeJohnson But it's not appropriate as an edit. It should either be a comment on that post or, if there is enough information to add, a new answer that references the previous answer. Editing a non-wiki answer to change the content of the post to such a significant degree is not an appropriate use of the editing system. – Servy Feb 13 '13 at 18:38
  • @Servy From the page about the Editing Privilege: When should I edit posts? Any time you feel you can make the post better, and are inclined to do so. Editing is encouraged! and Some common reasons to edit are: ... to clarify the meaning of a post without changing it. In fact, I'm adding that to my answer :) – Rachel Feb 13 '13 at 19:13
  • @Rachel Which you can only do when the meaning of the post is clear, which isn't done here as there isn't sufficient information to derive any intent. Meaning is being added to the post with this edit. – Servy Feb 13 '13 at 19:16

I follow this fairly simple decision flow on all edits

           |                               |
           |   Do I understand the edit?   +---No----->  Skip
           |                               |
            |                             |
            | Does the edit substantially +---Yes----->   Approve
            |     improve* the post       |
            |                             |

I could see this particular edit both ways. If you're new to programming that edit is extremely helpful. If you're not new it would be minor and would seem like fluff.

*Note: you can't substantially improve a post while simultaneously abusing the suggested edit functionality. Adding spam, radically changing the intent of the post or commenting on the post would be examples of abuse.

  • This should be something that people have pushed in their face when reviewing suggested edits... – ben is uǝq backwards Feb 12 '13 at 21:00
  • By this logic it would be appropriate to just delete the entirety of a poor quality answer and write your own from the ground up as an edit. This covers incorrect edits, minor edits, vandalism, and a lot of edge cases, but not comments as edits or radical change rejection reasons. Or are you asserting that neither of those rejection reasons should exist? – Servy Feb 12 '13 at 21:29
  • 1
    I don't think obliterating a bad post is the same as "improving it". – Some Helpful Commenter Feb 12 '13 at 21:32
  • 1
    Obliterating a wrong answer and replacing it with a better one is "improving it", but is not a valid edit. Your flowchart should take into account the degree to which the original information in the answer has been altered, supplemented or excised. – Asad Saeeduddin Feb 12 '13 at 21:35
  • 1
    Based on your edit, you have a complex definition of "improve", one that goes beyond the dictionary definition. Since you're basically putting all of the rules that SO has for what edits to be accepted into your definition of "improve" your flowchart in effect boils down to: "Do I know if this edit should be approved? If no, skip, if yes -> "Should this edit be approved? If yes, approve, if no, reject". Which is entirely correct, and also entirely unhelpful to a reviewer. Do edits adding full descriptions to code-only answers improve them? That's the question, and you didn't answer it. – Servy Feb 12 '13 at 21:53
  • @Servy My answer was I could see this particular edit both ways. If you're new to programming that edit is extremely helpful. If you're not new it would be minor and would seem like fluff. So edits adding full descriptions can improve code-only answers but not always. – Some Helpful Commenter Feb 12 '13 at 23:14

I disagree, i think it should only be rejected if it is simply something like: "This should work" or "This will work"

I would not add them to the audit, as they are still contreversial, and not unaimous in their decisions.


I reverted the edit.

The question is three years old, and already has an accepted answer with 20 upvotes on it. Edits and new answers to very old questions are a common technique employed by low rep users trying to find a way -- some way -- to earn a little rep. If you see these, and they don't add substantial value beyond the original post, feel free to decline them.

I admit that this is a little more work, but once you've seen the entire post, the correct course of action becomes apparent.

  • 1
    I think it's worth addressing the general issue here, and not just making this about one post, particularly given the lack of consensus on this issue. – Servy Feb 12 '13 at 16:09
  • 1
    Just use your best judgement; that's more than you can expect from some reviewers. Making changes to old posts is a general issue; it's very rare to see this kind of thing on new posts, and since the OP is there, they'll generally revert. – user102937 Feb 12 '13 at 16:10
  • 2
    I suspect part of the reason for that edit is that there is a comment on the post asking the OP to clarify what is going on in the code. Personally I thought that edit made the answer better, and should not have been reverted. – Rachel Feb 12 '13 at 21:09
  • Yeah, @Rachel, but it's a three-year old post. That better be an Academy Award edit to justify bumping a three-year old post with an accepted answer having 20 upvotes. – user102937 Feb 12 '13 at 23:09
  • 1
    @RobertHarvey There are plenty of times when I come across a useful posts that are years old when I am seeking solutions. The age of the post shouldn't matter when deciding if you should improve a code-only answer by adding an explanation of the code or not. Also, once the change has been made, then what's the point in reverting it? It's already been bumped to the active list again, and you're only bumping it a 2nd time to make the answer worse. – Rachel Feb 13 '13 at 12:55
  • @Rachel: Well, I already argued below this question that it could go either way. But ultimately, edits should respect the original author and the intent of their post, and in the three years that I've been here, I've never tried to explain someone else's code in an edit, not even once. I use comments for that. – user102937 Feb 13 '13 at 15:41

I'm inclined to reject this edit as a "radical change". The design of edits is to improve the post without changing the content of the post. You should be making it easier for others to comprehend what the original author's message was. You shouldn't be changing what that message is as long as their name is signed to the post. If the post is marked as community wiki then it is specifically saying that such edits for content are acceptable, so unless the post is a community wiki post, such edits shouldn't be approved.

If the user wishes to add additional information to the answer that is provided, since it lacks an explanation, there are two primary avenues. The first is that the user could add a comment to the post that includes additional information they feel should be included in the answer. If the original author feels that the additional information is valuable to the answer they may include to incorporate it into the answer (which is after all the point of comments; to improve answers). This is why some people choose to reject edits like this as an "Invalid Edit" since an invalid edit applies to, "[...] an attempt to reply to or comment on the existing post" and this edit should instead be a comment on that post. Personally I feel this particular answer leans more toward "radical change" but both clearly apply, so I wouldn't argue with either. Also note that the revision comment that the editor used is: "Added a comment describing [...]". Clearly even the editor feels that this is a comment on the answer, they simply do not have the reputation to post a comment in the SO sense, so they choose to edit instead.

If the content the editor is intending to add cannot be made into a comment either because there is too much content, it requires formatting, or because the OP choose not to incorporate it into the post and they feel it is very valuable, another option they have available to them is to post a new answer to the question that incorporates portions of the previous answer (it should be cited as per CC-wiki) and also includes the additional information.

You mention "too minor" in your question here, and that clearly does not apply. The problem with this edit is not that it isn't changing enough to be worth the reviewers time.

  • 1
    Is it really this complicated? – user102937 Feb 12 '13 at 15:38
  • I mention that some have been rejected as "too minor". I wasn't referring to this one. – Cole Johnson Feb 12 '13 at 15:41
  • @RobertHarvey From who's perspective? From a reviewer's perspective this make reviewing much easier. I don't need to understand the content of an edit, I can reject anything that clearly changes the meaning of the post. From an editor's perspective, it can make things a bit harder as you need to clearly understand the meaning of what they're saying to ensure you don't change it, so it can make that a bit more complex, yes. – Servy Feb 12 '13 at 15:41
  • @RobertHarvey Yes. Yes it is. – Cole Johnson Feb 12 '13 at 15:41
  • I would agree that either a comment or another answer are acceptable, and perhaps even preferable. But given that we are coming from the perspective of someone reviewing edits, if the edit gets rejected the most likely thing to happen is that the content that was added it simply gone forever. It is unlikely the person who made the edit will come back and post as a comment/answer. I am in favor of accepting it, so that the site can retain the added content. – FoamyGuy Feb 12 '13 at 15:42
  • @ColeJohnson Clearly this exact one hasn't, but any that even resemble this one shouldn't be rejected as "too minor". If someone rejected this edit as "too minor" I would say it was in error. – Servy Feb 12 '13 at 15:42
  • @Tim That then encourages more people to make edits such like this despite the fact that you yourself have said a comment or another answer would likely be preferable. If these edits are rejected the editors should quickly learn that they're not appropriate and begin using a more appropriate mechanism for adding the content. If you're that worried as a reviewer you could comment on the post (since they suggested an edit they'll be notified with an @ comment) and point the editor to a thread such as this detailing the appropriate way to add that kind of information. – Servy Feb 12 '13 at 15:44
  • @Servy I said "perhaps even preferable" Maybe I am nit picking, but I wouldn't personally say that it is "likely preferable" Either way though. I am simply in favor of the added content remaining on the site for others to benefit from. If the "correct" way to add it is as a comment or another answer I am fine with that. But I don't feel that doing it the "incorrect" (editing) is bad enough to warrant risking that content being lost. Note I genuinely don't know which is "correct" (or why) are there guidelines laid out some where that you can refer me to? – FoamyGuy Feb 12 '13 at 15:49
  • 5
    I disagree about the purpose of edits, I'd simply stop at "The design of edits is to improve the post." The major problem I personally have with "code only" answers is that they don't explain why the original code was wrong, how their solution works, why it's the correct approach, etc; all of this is (in my opinion) vital to making an answer worthwhile. All of the relevant, useful information should be contained in the main post; reading comments shouldn't be required to get the full picture. – Anthony Grist Feb 12 '13 at 15:50
  • @AnthonyGrist If you don't feel an answer is worthwhile then you should downvote it. If you feel that none of the existing answers are sufficient then add your own answer. That's the appropriate tool in this context. – Servy Feb 12 '13 at 15:51
  • @Tim The FAQ page is rather vague on the topic, only listing some general edits that are appropriate, but not indicating in detail what isn't appropriate. My primary citation would be the rejection reasons and their sub-text. Clearly this suggested edit radically changes the content of the post, and it is also attempting to comment on the post (making it an invalid edit). – Servy Feb 12 '13 at 15:56
  • @Servy In most cases that's exactly what I'd do. However, if there's already an upvoted, existing, accepted answer to a question, and there's value to be gained from adding additional explanation, then I see no reason people shouldn't make edits. It's all about making the information as easily accessible to other users as possible; the less places they have to look for it, the better. – Anthony Grist Feb 12 '13 at 15:58
  • @AnthonyGrist As I said, "if none of the existing answers are sufficient" clearly one of the other answers in this question is sufficient, so just leaving a poor quality answer alone is enough, I agree. I'm also making a specific point of keeping this meta question more general than just this one suggested edit, but about suggested edits that add a description of a code only answer in general, since that's clearly what this meta question is asking about. – Servy Feb 12 '13 at 16:00
  • @Servy yes, there is some opinion about debugging, but that's not really opinion per se - the debugging note isn't; I though the same thing. Anything that aids in debugging is good if it works. – Cole Johnson Feb 12 '13 at 16:35

You must log in to answer this question.

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