26

I tried to edit a typo in a code snippet in answer from another user (here, 4-letter edit to make, owner fixed it) but I couldn't even submit my change for review as it is only 5 char long.

This specific typo was quickly fixed but in a more general context, what is the right thing to do?

  • Leave the typo and ask the owner to correct it in comments?
  • Add some "junk" in edit to make it long enough:
    • add code comment?
    • add an "updated" line?
  • Flag the answer?

According to comment privilege help page comments are not supposed to be used for correction:

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;

Furthermore, what should be done if a typo persists after the owner was notified via comment?

  • Nothing?
  • Comment again?
  • Downvote?
21
  • 22
    I'd opt for "Leave the typo and ask the owner to correct it in comments?" Commented Apr 18, 2016 at 13:14
  • 6
    I tried to edit a typo in a code snippet - never edit ANY part of the OP's code. You can always leave a comment.
    – TheLostMind Mod
    Commented Apr 18, 2016 at 13:15
  • well, there is an "edit" button... maybe this should be available at some higher privilege then
    – Preuk
    Commented Apr 18, 2016 at 13:17
  • 2
    No. Edit button should not be used to edit typos or syntax errors
    – TheLostMind Mod
    Commented Apr 18, 2016 at 13:22
  • OK get it, edited my question to account for your comments. What should be done if a typo persists after a comment was left to owner?
    – Preuk
    Commented Apr 18, 2016 at 13:27
  • 3
    This is not about the question but for an answer (a good one, accepted it juste after the typo was fixed); privilege section states this kind of minor edit should be OK: meta.stackoverflow.com/questions/296872/…. The main problem is length limit, which prevents this edit (which could indeed be rejected).
    – Preuk
    Commented Apr 18, 2016 at 13:33
  • @TheLostMind: for Preuk, "close" → "flag to close".
    – Jongware
    Commented Apr 18, 2016 at 13:34
  • @Preuk - If it is an answer, you are free to DV it (if leaving a comment doesn't work).
    – TheLostMind Mod
    Commented Apr 18, 2016 at 13:36
  • 35
    Downvoting a correct, well-explained answer because of a typo sounds like a loss for community to me.
    – Preuk
    Commented Apr 18, 2016 at 13:45
  • 3
    Relevant answer: meta.stackoverflow.com/a/260246/2751621. According to this (for code edits): "Correct spelling/grammar issues in the answer body" is encouraged. Commented Apr 19, 2016 at 17:54
  • 10
    @TheLostMind nonsense; a total prohibition on code editing has never been a rule or community norm and goes against the advice at meta.stackoverflow.com/q/260245/1709587
    – Mark Amery
    Commented Apr 19, 2016 at 19:30
  • 1
    @MarkAmery - Well.. Changing technical details in code is not acceptable and the link you pointed to implies the same thing. The only other things that could be changed are code formatting or other non-technical details. formatting code is not changing code. Also, I don't think correcting typos is a good idea either. BTW people should be polite when they disagree with something someone says. Nonsense.. is not the right way of talking to anyone.
    – TheLostMind Mod
    Commented Apr 20, 2016 at 5:02
  • 4
    @TheLostMind, actually the accepted answer for that post encourages to "Fix syntax errors and typos*1". Note: there is a footnote that IMO is makes sense. Commented Apr 20, 2016 at 13:33
  • 2
    @TheLostMind about the polite thing. Doesn't that depend on the demographics? I mean, "nonsense" is a polite word here. Bullshit on the other hand... . Commented Apr 21, 2016 at 7:57
  • 1
    @ElvioMartinelli - true, but you have to be careful as people can (and do) interpret it as it being OK to edit code in questions.
    – ChrisF Mod
    Commented Apr 21, 2016 at 13:39

1 Answer 1

19

Well let's quote:

If the error appears to be an inadvertent mistake or omission, then fix it if you can.

If it appears that the author intended to write what he wrote, then leave it be. Down-vote it. Maybe leave a comment. But don't correct it - if it turns out that he was right, you'll have just sabotaged his efforts, and even if he is truly wrong, he may be fond of his ignorance, and his example may prove instructive to others who hold similar notions.

So, yeah, you have the tools, the time and the knowledge to fix it; go ahead and fix it! BTW, your edit could have been accepted by the system if you had thrown in some indentation.

4
  • Tried re-indenting it to raise char count to no avail.
    – Preuk
    Commented Apr 18, 2016 at 13:58
  • 3
    "your edit could have been accepted by the system if you throw in some indentation." Whitespace for indenting/formatting code doesn't count for the 6 character limit for suggested edits. cc @Preuk (whitespace in general doesn't, really.)
    – Kendra
    Commented Apr 18, 2016 at 15:07
  • 1
    @Kendra: so when < 2k rep and fix is small, what can be done?
    – Preuk
    Commented Apr 19, 2016 at 12:34
  • 7
    @Preuk Either find something fluff to fix (Like a small re-wording that keeps intent (which might not get past the queue)) or just comment on the post, unfortunately. (Unless you scour the post and manage to find a grammar fix or a spelling typo! Then just fix those.) It can be a pain, but at least you and I have enough rep to comment on the issue. It'd be a bigger pain if we didn't.
    – Kendra
    Commented Apr 19, 2016 at 12:55

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