-7

Revision 5 of this question reintroduces an obvious typo fixed by Revision 4. How should we handle edits like this?

(Obviously, this isn't a good question to begin with. I'm not trying to rescue it; it's just an illustrative example of a horrible edit.)

11
  • @Kendra: By the letter of the law, I agree. But there's exactly one reasonable way to make the code express the symptoms listed, and that's what revision 4 did. It seems absurd to reject an edit that renders the question coherent and answerable.
    – tmyklebu
    Commented Jan 6, 2015 at 19:59
  • 2
    Well, the correct way to handle that, tmyklebu, is to comment to the asker of the question that there is no way to achieve what they listed with that particular error in their code. It is still considered an incorrect edit if it changes the code of the question. Related: meta.stackoverflow.com/questions/252806/…
    – Kendra
    Commented Jan 6, 2015 at 20:02
  • Also, Revision 4 wouldn't have been "rejected" anyway because the user has edit privileges. If they didn't, they would not have been able to make that small of an edit at all.
    – Kendra
    Commented Jan 6, 2015 at 20:04
  • @Kendra: The accepted answer to the question you link uses the reasoning "you can't tell for sure what the true intentions were." That's obviously not the case here. Further, ChrisF's answer suggests editing.
    – tmyklebu
    Commented Jan 6, 2015 at 20:05
  • And you can't know for sure that the OP did not have that in their actual code (as in true intentions). Yeah, it might not run with that, but the point is do not make any edits that risk removing the problem. Also related: meta.stackoverflow.com/a/266479/2607247
    – Kendra
    Commented Jan 6, 2015 at 20:08
  • 1
    @Kendra: That edit does not risk removing the problem. In the second question you link, the reasoning for rejecting code edits is that "the original code may be part of the problem." Here, it is clearly not. Do you have any meta links that actually support your (and Servy's) position?
    – tmyklebu
    Commented Jan 6, 2015 at 20:09
  • And my last note on this: There is a FAQ post about when to make edits to code. To quote verbatim the relevant part: "Don't: -Fix Syntax (non-closed brackets, missing semi-colons, etc.) -Fix typos (misspelled function calls, variable names, etc.)" In other words, do not fix the code in the question. Period. Regardless of reason.
    – Kendra
    Commented Jan 6, 2015 at 20:09
  • 1
    @Kendra: Again, the reasoning your post uses is that the edit might mask the original problem. That is not possible here.
    – tmyklebu
    Commented Jan 6, 2015 at 20:10
  • 1
    @tmyklebu It's certainly possible. It may not be the case, but it's a possibility. If nothing else it's a very strong indication that there are other differences between the code in the question and the code the OP is running.
    – Servy
    Commented Jan 6, 2015 at 20:12
  • 1
    @Servy: I wait with bated breath for your illustration of how #include <sdtio.h> in a novice's C program would cause anything other than a compilation error.
    – tmyklebu
    Commented Jan 6, 2015 at 20:15
  • 2
    @tmyklebu You know that there is a problem. What you don't know with certainty is what the solution to that problem is. You have determined that the OP's code doesn't replicate his results, meaning he has not given you the code he's actually using. Given that the solution is to get the OP's real code, rather than to try to guess what his real code is (especially if you guess wrong).
    – Servy
    Commented Jan 6, 2015 at 20:18

1 Answer 1

10

If it looks like it was just a mistake and that the edit was made in good faith, edit the question (or suggest an edit) to fix it and then just move on.

If it looks like it was done intentionally to vandalize the post, then flag the post and explain the situation so that a moderator can look into it. If you have noticed a pattern of such behavior you should include information about that when flagging.


As for this specific case, the error was in the original question. Some user tried to edit the question to fix the error in the code. This is completely inappropriate. You should not be editing code in a question to fix errors. The errors being fixed may well be (or be related to) the problem that caused the question to be asked in the first place.

Here the editor of revision #5 was, correctly, reverting the code in the question to match what the author posted.

If you feel that this error is the cause of the problem, and that fixing it answers the question, then post an answer. If not, then a comment would be appropriate. If the author wants to fix it due to it being unrelated to the question, they can.

7
  • What about the case where there's too little information to tell? I'm leaning toward just leaving this one be.
    – tmyklebu
    Commented Jan 6, 2015 at 19:51
  • 4
    @tmyklebu Assume good faith until you have compelling reason to believe otherwise.
    – Servy
    Commented Jan 6, 2015 at 19:53
  • 3
    Something doesn't smell right about your "this is completely inappropriate." There's exactly one reasonable way to make the code produce the symptoms described in the problem, and that's what edit 4 did.
    – tmyklebu
    Commented Jan 6, 2015 at 19:56
  • 7
    @tmyklebu There are an infinite number of ways of altering the code in the question. If the code in the question doesn't replicate the described results then clearly there is some problem with that code. Tell that to the author. Clearly he has not provided the correct code. Maybe there are other problems as well. You should be commenting on the post to draw attention to this issue with the question so that it can be fixed. Editing the code in the question to be what you think it might be is not the correct course of action though.
    – Servy
    Commented Jan 6, 2015 at 19:59
  • "If you feel that this error is the cause of the problem, and that fixing it answers the question, then post an answer."? What? No, if that's the cause of the problem, then clearly the question should have been closed as caused by a typo. And as further edits demonstrate, the problem was indeed unrelated - and a common problem closed as a duplicate. Commented Jun 13 at 0:21
  • @KarlKnechtel Not all errors in code are typos. A very small subest of them are. If the specific question asked is in fact entirely resolved by a simple typo, then sure, you could vote to close accordingly. Likewise, if the question is a duplicate, by all means, vote to close accordingly. All this answer is saying is that editing a question to fix what you believe is the problem is not appropriate, as it leaves a non-sensical question.
    – Servy
    Commented Jun 13 at 0:37
  • Okay, but the putative typo in question was writing sdtio.h instead of stdio.h, and the problem reported was not a linker error nor anything to do with standard library functionality, but an issue with understanding integer division. It seems more likely to me that OP made the typo when typing in an example into the post (this is why one should copy and paste it instead!) rather than in the actual local code. (BTW: was "subest" intentional?) Commented Jun 13 at 2:23

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