4

I don't have a lot of experience with SO, so I'm trying to understand what's acceptable here. I made an edit to an answer that I thought was constructive and for the benefit of the readers, but it was almost immediately rejected by 4 reviewers.

The answer in question is here. It's technically incorrect, but is accepted (I did not intend to challenge this with my edit, nor do I think that I did). Additionally, it presents a sample JavaScript snippet that would cause an infinite loop when executed. To make matters worse, the answer links to a JSFiddle executing this snippet and if a reader follows the link, the browser ends up hanging and could force the user to kill it (potentially losing some unsaved work).

Here is the edit that I made to the code: rejected edit

As you can see, while the question was asking for a regexp to solve a particular problem, I did not even touch the proposed regexp and only fixed the offending (infinite) while loop involved in console logging. I also removed the jsfiddle link that would cause the browser hang. The meaning of the answer, in my opinion, remained completely unchanged.

The first thing that I find confusing, is that the reasons given for rejection were "The edit is incorrect or an attempt to reply to or comment on the existing post". I don't see how my edits do any of that. Additionally, the reply I got from the author of the answer was that "[my] edit was rejected because [I] completely changed [his] answer". I personally don't believe that I did, but I do not want to challenge (too much) an SO user who has way more experience with SO than I do.

So at this point, I am quite confused as to what constitutes an appropriate edit to an answer. Especially, since when you go to edit an answer, the message at the top states "We welcome all constructive edits, but please make them substantial. Avoid trivial, tiny one-letter edits unless absolutely necessary". What is substantial, but not over-substantial?

1

1 Answer 1

4

Well, at the end of the day, it is widely open to interpretation whether a given edit is consistent with the author's intentions or not. When I look at that code I would say that it was the authors intention to re-execute the regular expression on each iteration of the loop, but it was just a trivial little mistake that they didn't notice, as such, I would consider it an appropriate edit to fix. (Of course, as I mention in my third paragraph, it seems I did not correctly analyze the author's intentions, but that is how I would have reviewed this edit.)

You'd find, though, that most reviewers tend to be overly conservative when it comes to code edits. Many people outright reject any edit to code of any type, without any further consideration. This is contrary to the site's policies, which would suggest restraint and caution when editing code, but not outright refusal to touch it (as opposed to question, to which code really shouldn't be touched at all, as you don't want to fix the problem that the question is inquiring about).

However, in this case, the comments on the post make it clear that the authors intentions are for the post to be exactly what it is, and that they don't want it changed. Given that, there isn't anything for you to do besides downvote the incorrect answer, and consider posting another answer that works. (You already have a comment, otherwise I'd say that you could optionally explain the problem with the current answer.)

6
  • I also agree that not all code edits are bad. This particular one was probably substantial enough to justify its own answer with detailed explanations (it's not merely a case of a misspelled identifier, or a misplaced comma or semicolon; it actually changes the code logic).
    – Robert Harvey Mod
    Commented May 12, 2014 at 19:59
  • @RobertHarvey I can certainly understand rejecting this edit; I agree it's not a clear cut case. To me personally, while the number of characters of code edited isn't tiny, the intention of the programmer seems to clearly be that the regex is executed on each iteration, so fixing that isn't just making the code work, it's making the code do what the author meant it to do. I don't see it as the authors intention to execute the regex once and then iterate on that one result over and over. I was, of course, wrong, and it seems that is his intention, although I have no idea why.
    – Servy
    Commented May 12, 2014 at 20:02
  • While suggested editors may see these kinds of suggestions declined, users with editing privileges can make these changes unilaterally, barring some kind of rollback. I went ahead and made a similar edit myself, and notified the poster.
    – Robert Harvey Mod
    Commented May 12, 2014 at 20:06
  • Thanks @robert-harvey. I see that I could have done a less intrusive edit to convey the same idea and perhaps that would have passed review. I'll keep that in mind in the future.
    – Aurimas
    Commented May 12, 2014 at 20:16
  • @RobertHarvey I would have made such an edit, if it weren't for the comment from the post author indicating that he feels that the edit isn't appropriate. I would have assumed, if he recognized the simple mistake as a mistake, he would have simply fixed it himself at that point.
    – Servy
    Commented May 12, 2014 at 21:15
  • Eh, I changed my mind. I'm not entirely sure that the original edit worked anyway.
    – Robert Harvey Mod
    Commented May 12, 2014 at 21:44

You must log in to answer this question.

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