14

I had a question and a suggestion about suggested edits.

Yesterday I noticed that an answer to a question had a syntax error in the code, so I decided I should fix that error so that the OP wouldn't get confused, and so that future users who looked at the answer would actually see code that worked. The person who answered the question easily implied by other portions of his code what the syntax error should be corrected to; someone had even said in the comments how the error should be corrected.

So, I went ahead and corrected the error. However, my suggested edit was rejected.

So I tried again, including what the syntax error was in the reason for editing, hoping users who actually new vb.net would review the edit. But, the edit was rejected again; however, this time the edit was approved by one person. So overall, the edit had been rejected by 6 users, and approved by one.

I looked at the tags the reviewers commonly use, and the 6 that rejected my suggestion never use the vb.net tag, so I assume they don't know it. The one users who approved my answer used the vb.net tag fairly often. And then today I tried editing again, and it got approved by three users, all who use vb.net.

What should I do if something like this happens again? Should I leave the syntax error, or keep editing it until it gets approved? Or is there something else I should do? I'm not trying to pick on any of the reviewers, but I have come across this myself when reviewing first posts: sometimes I don't know the language, but still review it.

Thanks for your help!


Some people seem to argue that it is never good to change an answer's code. However, I have noticed that lots of users do. I put an example in a comment below, and here is another example I came across (on accident): https://stackoverflow.com/posts/19282384/revisions. The reason it was edited was because there was a syntax error. (Try putting if (1 == 1) && (2 == 2) into a C# compiler...it won't work.) (also see here and here, where in the latter someone literally rewrote the whole code block...) Some users have said that if there is an error, the user who noticed it should put a comment. But I know if I typed a little (or big) syntax error, I would much rather someone just correct it instead of telling me and letting me fix it.

However, as the people who don't like users editing each other's code very truly pointed out, someone could completely change the meaning of the code to something the original poster didn't want. So I had a suggestion on a way to try to fix this: If someone edit's an answerer's code, the edit will take place like normal; however, the original poster will be notified someone edited their code, thereby enabling them to check to see if the revision's correct. I don't know, I just thought I might mention that. SO is a great website that is organized and designed very well, so there might be a very good reason there isn't something already like this.

22
  • 21
    Your edit was rejected for another reason. You substantially change the answer and it doesn't matter if you are improving it or not - this becomes a different answer altogether. In such situations you should leave a comment (or provide your own answer) instead.
    – sashkello
    Oct 9, 2013 at 0:39
  • 7
    @sashkello The sample edits aren't what I'd call a substantial change. They're just API corrections. The core of the answer is still the same, and the only difference is that the code post-edit works.
    – Adam Lear StaffMod
    Oct 9, 2013 at 0:49
  • 8
    @Anna but isn't the general convention that we don't fix other people's code because it's messy, can lead to unintended consequences, and not least the answer's author may never learn there was a correction? The edit had the best of intentions, to be sure, but a comment would have made more sense IMO.
    – Pekka
    Oct 9, 2013 at 0:53
  • 2
    @AnnaLear This is a common problem - what some would see a substantial change others don't. All in all, if it is an obvious typo (missing bracket or semicolon), it is not substantial. Otherwise it is better to comment. IMO
    – sashkello
    Oct 9, 2013 at 0:57
  • 7
    @perhapsPekka If that is a convention, it doesn't make much sense to me. The "skip" button exists for a reason. If you can't vouch for the edit's correctness, you don't have to reject it.
    – Adam Lear StaffMod
    Oct 9, 2013 at 0:58
  • 2
    @Anna the thing with fixing code is that it can have consequences further down the line that won't necessarily be caught in a review. That's why I'd never change code without the author knowing it (unless it's something really obvious like FizzBuzzFctory => FizzBuzzFactory)
    – Pekka
    Oct 9, 2013 at 1:00
  • 6
    None of the answers to the question are very good. They are all mostly just code blocks. If I were you I would write a good well-documented answer. If you don't wish to do so you can always leave a comment about what you think the error is.
    – dcaswell
    Oct 9, 2013 at 1:02
  • 1
    @perhapsPekka, I just want to point out that people do edit code. For example, this code was edited by someone other than the author. stackoverflow.com/posts/4172724/revisions And thanks for the suggestion dcaswell. I might try that next time
    – davidsbro
    Oct 9, 2013 at 1:06
  • 2
    @sashkello, that mainly applies to questions, where we don't want to mess up the code that they're asking a question about. Fixing code in answers is much different. Oct 9, 2013 at 1:48
  • 3
    I think the main reason not to edit code in answer is because you have no way of knowing if the author made a mistake or intended it that way. Also line between fixing and changing is very vague. Then he or she gets back to the post and it's different (and with some probability has new mistakes/typos or just different) - it shouldn't happen EVER. To avoid such situations I think editing anyone's code mustn't get past fixing typos (which doesn't include using different functions).
    – sashkello
    Oct 9, 2013 at 2:39
  • 3
    I don't see a problem in posting a comment in such case. If it is left with no reaction you can post an answer quoting the original. It is way better than replacing someone's answer with your own, even if the difference is only minor.
    – sashkello
    Oct 9, 2013 at 2:39
  • 1
    @dcaswell The answer isn't actually wrong, the asker just thought it was because he didn't have the correct version of .NET. I just don't think that creating an answer because someone forgot to type "box" is worth it. IMO, it would be much more effective to correct the answer, and let the original poster know that the post was edited.
    – davidsbro
    Oct 10, 2013 at 2:08
  • 1
    David, I'm pretty sure that when someone makes an edit to one of your answers, you are automatically informed. Also see discussions of this same issue from 2011 here and here, and from 2 months ago here.
    – jmac
    Oct 10, 2013 at 2:16
  • 2
    Really, 7 downvotes for this? User makes an edit that makes the code work, and people are downvoting him for wondering why people rejected it?
    – jmac
    Oct 10, 2013 at 2:38
  • 1
    +1 this is a good scenario. Editing the syntax (typo) is GOOD (not radically changing the code) and if the reviewer is not familiar with the code should SKIP!
    – user221081
    Oct 29, 2013 at 8:31

2 Answers 2

18

Your edit absolutely shouldn't have been rejected if we go by the helpful hints in the help center (see editing and comments).

Posts are Intended to be Collaboratively Edited

Editing is important for keeping questions and answers clear, relevant, and up-to-date. If you are not comfortable with the idea of your contributions being collaboratively edited by other trusted users, this may not be the site for you.

Useful Information in Comments Should be Edited in to the Post

Edits are expected to be substantial and to leave the post better than you found it. Common reasons for edits include:

  • To fix grammar and spelling mistakes
  • To clarify the meaning of the post (without changing that meaning)
  • To include additional information only found in comments, so all of the information relevant to the post is contained in one place
  • To correct minor mistakes or add updates as the post ages
  • To add related resources or hyperlinks

Comments are not Permanent

What are comments?

Comments are temporary "Post-It" notes left on a question or answer. They can be up-voted (but not down-voted) and flagged, but do not generate reputation. There's no revision history, and when they are deleted they're gone for good.

Comments are Not Intended to Correct Mistakes

When shouldn't I comment?

Comments are not recommended for any of the following:

  • Suggesting corrections that don't fundamentally change the meaning of the post; instead, make or suggest an edit;

The people suggesting that this should be a comment, or you shouldn't touch incorrect code in answers are throwing the baby out with the bathwater. Almost all suggestions not to change code is limited to questions.

Unfortunately, it is a lot easier for people to say, "Code change, no good" and reject your edit than to actually comprehend what you've changed and determine if it's good. For people who don't understand the language, it's like trying to correct Czech spelling -- you're not going to be a good judge. Ideally, people would hit 'Skip', but then they wouldn't be making progress toward review badges.

Personally I hope you keep suggesting these edits, or better yet make it to 2000 rep so you can edit them without the queue. These edits make the site better and provide better resources for future readers. They should be encouraged, not rejected out of ignorance.

21
  • The OP still says the answer is broken Is the suggested edits for fixing typos in incorrect answers?
    – dcaswell
    Oct 9, 2013 at 5:54
  • 7
    One piece of advice, though: Given reviewers' reluctance to accept code edits, any such suggestion needs to be absolutely clear. That means the revision comment needs to explain what was wrong and why the suggestion is right. For example, instead of "corrected code errors" — which is vague and could apply to nearly any change, even incorrect ones — I might have written "functions expect string property, not edit-box reference; fixed Message->MessageBox to match previous line." Reviewers are expected to read that to understand the context of the edit. Oct 9, 2013 at 5:55
  • @Rob, I think you are putting an undue burden on the editor. If I fix the grammar in a post, I don't quote the dictionary definition for 'their' vs. 'there' vs. 'they're'. I say, 'fixed grammar'. And that is enough because the reviewer understands the change with a glance. In this case the reviewer does not understand (like if the change was to French grammar), if the reviewer doesn't understand French, he/she should press skip, not expect the reviewer to explain what should be obvious to anyone who understands the language.
    – jmac
    Oct 9, 2013 at 6:15
  • @jmac If answer has something like "Add fuktion reply() to your code". It is easy to see that it should be "Add function reply() to your code". But what if it is "Add function repli() to your code"? You can think that "reply" is meant, but maybe not and editing it you create different answer.
    – sashkello
    Oct 9, 2013 at 6:35
  • While it is OK to edit answers, answer is still posted by some person who puts his or her reputation behind it. If you screw it up it's your fault but you never get punished. Changing code shouldn't be prohibited, but certainly should be something which one should do with extreme caution. "Suggesting corrections that don't fundamentally change the meaning of the post" - exactly my point. Fixing non-working code is fundamental IMO.
    – sashkello
    Oct 9, 2013 at 6:37
  • 1
    Maybe the burden's undue, but there's clear evidence that reviewers are extremely reluctant to accept edits to code. I wish that weren't the case, but that's the reality we live in. Therefore, I think editors need to make it as clear as possible that code edits are indeed warranted. Were it common for people who don't write English often, but who can still read it pretty well, to review edits, and they had a habit of badly rejecting edits they don't understand, then writing something more descriptive (and more accurate) than "fixed grammar" might increase chances it's accepted. Oct 9, 2013 at 6:39
  • 2
    What other code can be fixed, @Sashkello, if not the non-working kind? Oct 9, 2013 at 6:40
  • I don't think it has anything to do with reviewer understanding the language or not. If the edit is minor, it should be approved. If it is not, it should be a different answer. If you are not sure, then it should be a comment.
    – sashkello
    Oct 9, 2013 at 6:41
  • @jmac No, it is not. Because every language can have infinitely many functions with whatever custom names.
    – sashkello
    Oct 9, 2013 at 6:42
  • @RobKennedy OK, I meant fundamentally wrong code, not just code with obvious typos.
    – sashkello
    Oct 9, 2013 at 6:45
  • @jmac 1. Well, I'm not a standard human and so are many on this site which makes it better I believe. I'd have doubts what was meant and asked in a comment (again, if it is not blatantly obvoius). 2. Have you seen the actual edit this post is about? It changes TWO things and MessageBox is on the border of fundamental or not, but another .text edit is fundamental no matter how you look at it.
    – sashkello
    Oct 9, 2013 at 6:54
  • @jmac I didn't say that. Let's not go into personal stuff, OK? My knowledge of VB is not relevant at all (guess what? stackoverflow.com/search?q=%5Bvb.net%5D+user%3A1933347). We are talking about common practices. The question has txtBegin.Text. The answer has txtBegin. To me, as a human being not that far from standard, it seems that it was an intentional change. This may be the change which poster suggests as an answer. I don't care if it is correct VB or not. It is irrelevant. You are not supposed to change someone's answer to your own, no matter how much better it becomes.
    – sashkello
    Oct 9, 2013 at 7:12
  • 2
    @jmac You haven't even tried to refute my point. This particular edit replaces one answer with another answer. In this particular question you don't have to know VB to understand it. If there is doubt, skip it, sure. I would reject it because I don't have doubt in this case. I have enough reputation for it and this is my vote. I don't care how you feel about it because we both have enough reputation to do it and both part of the community. It is not because I want to feel good about it, but because I want to keep SO the way it is and do my small part for it (votes, edits, reviews, etc).
    – sashkello
    Oct 9, 2013 at 7:37
  • 2
    @jmac I've justified my position. Author of the post seemingly intentionally changed piece of OP's code. Changing it back fundamentally alternates the answer. You haven't provided any argument against it, as well as why it wouldn't be proper to post another answer fixing all these issues instead of editing.
    – sashkello
    Oct 9, 2013 at 7:40
  • 1
    @dcas, I have decided to take what you said to heart and have proposed a feature request you should wholeheartedly support.
    – jmac
    Oct 10, 2013 at 4:44
5

In my humble opinion and probably in also in the opinion of the people who rejected your edit, the kind of edit you made on that post should have been a comment. I don't think the reviewers knowledge on the subject should be a deal breaker on whether he accepts or not the edit.

Yes it doesn't change much AND yes you had a good edit message, but why couldn't it just be a comment? Or even, if it is a more substantial edit, a new answer. If the guy who answered is wrong, it's your task to tell him, not to correct it.

Edits should be there to correct typos, clarify the meaning (when it's obvious), improve the layout of the answer, retitle properly, retag properly, etc. But not to make an answer "correct" when it's not. It's not your answer (and what if the guy was right in another context). Yes it's Community base, but people don't really like to have word put in their mouth.

8
  • 5
    What benefit does a comment provide over directly editing the code? If the comment is correct, it just adds an extra step to fixing it in the answer. If the comment is incorrect, it creates ambiguity since comments can't be downvoted (and removing the comment would require another comment and cooperation of the commenter, or a mod). If the edit is made, the correction is immediate, and if it is wrong it can be corrected by the person who answered. This is exactly the sort of case the edit system was designed for!
    – jmac
    Oct 9, 2013 at 5:19
  • 2
    @jmac 1. Making wrong edit is FAR worse than making a bad comment. Firstly you are hurting the reputation of the poster. Secondly, why do you suppose he or she will ever get back and re-edit it? This is a slim possibility. 2. Since it is a collaborative effort, discussing improvements in comments is a pretty logical step to improve the post. If you get comments to your answer you are notified and you can get back and re-evaluate your answer accordingly. 3. Don't comment if you think the answer is wrong and you know how to fix it. Post your own answer. It is better than both comment or edit.
    – sashkello
    Oct 9, 2013 at 7:27
  • 1
    Correctness of the answer is verified by votes, not by edit/review system.
    – sashkello
    Oct 9, 2013 at 7:28
  • 4
    @sash, if the edit goes in to the queue, it is not unilaterally applied. This issue is only for sub-2000 rep editors. If the edit (after approval) does not solve the problem, the asker can point that out. If another poster comes across and knows it is wrong, they can roll it back if they have over 2000 rep, or can put it in the suggested edit queue otherwise. Posting a second answer with identical logic and two syntax errors fixed is absurdity, and flies in the face of the collaborative editing principles stated in the [help/editing]. If you take issue with that, make a separate meta question.
    – jmac
    Oct 9, 2013 at 7:33
  • @jmac If the question was about syntax errors (like this one), all the answers will have similar logic, nothing wrong with that. Fixing syntax errors IS fundamental in such case. The one which fixes them all and have nice explanation of what's going on will get upvotes and probably will be accepted. People don't click on edit history that often and changes of a roll-back are extremely small. Wrongly edited answer will likely be ignored or downvoted, and again, making it wrong is way worse than making wrong comment.
    – sashkello
    Oct 9, 2013 at 7:49
  • I don't see where this discussion is going. The upvotes on this answer are clearly showing the power of collaborative thought. I do comply with many meta-discussed practices which I don't really agree with, because community decided this way. Let's leave it for community to decide this time as well.
    – sashkello
    Oct 9, 2013 at 7:52
  • Preventing productive edits that provide better quality answers and better resources for future visitors are not 'showing the power of collaborative thought'. Feel free to disagree. Disagreement is good. However, when disagreeing, think about the bigger picture and what support for a certain position will have on the quality of the site. If the quality of the site suffers, no amount of upvotes makes it a good idea.
    – jmac
    Oct 9, 2013 at 8:02
  • 4
    NO. Correcting mostly-correct answers, like this one, is a valid and encouraged edit. Comments are only for unresolved issues, such as “there's an error but I don't know how to correct it”. If there's an error in a post and you know how to correct it without fundamentally changing the post, editing is the right thing. This is very clearly spelled out in the SE rules, in particular the about page, editing help, and the comment privilege description. Oct 10, 2013 at 8:44

You must log in to answer this question.

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