9

I corrected some wrong code in this answer and the edit was rejected almost instantly. Could anyone explain why?

4
  • 11
    Not sure why this is down voted, seems like a neutrally worded request for feedback Sep 18, 2013 at 13:27
  • 9
    @Richard because it's a duplicate. It's pretty pathetic that people downvote duplicate support questions. They help people find the main one if they search for something else. Like they may search for something that is only here, not there. If this didn't exist, then that user would make it a question, and the cycle repeats.
    – Cole Tobin
    Sep 18, 2013 at 15:49
  • 2
    @ColeJohnson This isn't a duplicate: this was actually an edit to an answer, not a question. Sep 19, 2013 at 9:35
  • 1
    As stated, this is not a duplicate of that question, though it may be a duplicate of similar issues from 2011 here and here, and from 2 months ago here, or a couple days ago here.
    – jmac
    Oct 10, 2013 at 2:20

2 Answers 2

22

You have edited code in an answer.

Your changes include adding a space character (function (e) instead of function(e)), which is only a matter of personal coding style, as well as performing a strict equality comparison against a number instead of a non-strict comparison against a string (which are roughly equivalent in Javascript, and also a matter of personal style).

You should refrain from editing code to have it conform to your own coding style. Such edits will be summarily rejected most of the time. That's the answerer's code, not yours: except for obvious typos, leave it as it is.

6
  • 2
    Does it matter that the code didn't work before I edited it and did work after I did?
    – kzar
    Sep 18, 2013 at 13:35
  • 5
    @kzar, that's only because you fixed the typo in stopPropagation(). Your other changes did not make the code any better (or worse, for that matter). Sep 18, 2013 at 13:46
  • 3
    Well it's not fair to say the comparison correction did not improve the code but I accept the rest of the changes were stylistic. Unfortunately I couldn't submit a change with less than 6 characters difference though so the tweaking was thrust upon me rather.
    – kzar
    Sep 18, 2013 at 13:53
  • 5
    You did not have to edit the code and nothing was thrust upon you. I understand your frustration, but until such time as you have enough reputation to be "trusted" by the community to make unreviewed edits I would avoid editing code (for your own sanity, as edits to code in general are suspect especially accepted answers).
    – user7116
    Sep 18, 2013 at 14:09
  • @user7116 I hope most people will understand why not to edit code before they get to be trusted to make unreviewed edits. Except putting code in a code block if it isn't in one yet. But that's hardly editing code in the first place.
    – Mołot
    Sep 19, 2013 at 8:24
  • 5
    @kzar Yes, it did matter, and I think this edit should have been approved. Correcting something that almost worked, but had a minor mistake, is what edits are all about. Sep 19, 2013 at 9:39
12

Editing someone's incorrect code is not a good practice. If you think the answer has some issues, you can comment on the answer. If the author don't reply you, you can downvote the answer and add your own answer with valid code. So reviewers mostly reject such edits.

9
  • I was not allowed to comment on his code as I had < 50 karma. (I see that Hugo Dozois - as well as marking this question a duplicate - has gone in and added the comment himself.)
    – kzar
    Sep 18, 2013 at 13:55
  • 2
    @kzar If you don't have enough reputation to comment then earn that reputation, and then comment. You aren't permitted to violate the rules simply because you don't have enough reputation to do what you would like to do.
    – Servy
    Sep 18, 2013 at 14:04
  • 4
    No I think rather than jump through hoops - on the way to what was already a favour for the next reader - I'll simply not bother with any of this at all.
    – kzar
    Sep 18, 2013 at 14:07
  • 2
    @kzar: the hoops are actually a means of including newer users. Previous to these hoops you had 0 means of editing input.
    – user7116
    Sep 18, 2013 at 14:12
  • 3
    I thought it was a fair enough edit and well explained. I would have approved it. Had it been the questions code snippet then I'd have rejected.
    – Kev
    Sep 18, 2013 at 15:52
  • 3
    Editing someone's mostly-correct code is good practice. Please read the official editing guidelines (“When should I edit posts? (…) To correct minor mistakes”). A comment is only appropriate when you know that something is wrong but are unable to correct it: comments are for unresolved issues. Sep 19, 2013 at 9:38
  • @Gilles - May be you have misunderstood "some issues". I didn't say I will reject typo correction. But I will probably reject edit of some minor-looking mistakes like using SUM instead of COUNT (for e.g.).
    – Himanshu
    Sep 19, 2013 at 9:46
  • 4
    @hims056 Your example sounds exactly like the kind of minor mistake that should be corrected by an edit. Sep 19, 2013 at 10:05
  • 2
    What @Gilles said...in the (non-)capacity as an SO ex-mod.
    – Kev
    Sep 20, 2013 at 22:09

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