This answer was posted with non-compiling, invalid code by the original poster, and it was downvoted accordingly for that reason.

An 80K+ reader edited the code to totally rewrite it to working condition, even enhancing it somewhat for proper error handling. I reverted the edit, and posted a link to this meta post, where the consensus was that code edits should be restricted to formatting issues.

Another user (200K+) reverted my change and reinstated the previous edit.

I'd like someone to review this post, because if a major rewrite of someone's answer is appropriate, IMO it defeats the purpose of being able to downvote poor (or wrong) answers completely.

Can a mod or two take a look at the revision history of the question and chime in here on the propriety of the edit?

  • Oddly this didn't get a "possible rollback war" flag generated on it. – Flexo Jul 13 '13 at 11:20
  • @Flexo: I can add it. :-) – Ken White Jul 13 '13 at 11:24
  • 2
    That is an answer, not a question... if the answer was incorrect and then corrected is there really a massive problem with the edit? The poster is new(ish) to the site and has hardly posted anything. Helping them out would be the neighbourly thing to do. – ben is uǝq backwards Jul 13 '13 at 11:28
  • @benisuǝqbackwards: I corrected to indicate answer rather than question. The issue here is whether an editor can make major revisions to invalid code. IMO, it discourages the poster from bothering to test in the first place ("Hey, someone will fix it if it's wrong"), and it changes the answer substantially (in this case, an answer that had received two downvotes for being incorrect, which then became invalid once the code was rewritten by someone else; two people felt it was poor enough to give up their own rep by downvoting, only to have those votes made meaningless by an editor). – Ken White Jul 13 '13 at 11:35
  • 4
    I'm sorry Ken, but I still don't see a problem here. The downvoters can get their rep back by retracting their vote now its been edited. Yes, it might make the poster lazy but they're not going to get this help on every answer and they'll soon learn. I'd rather answers were correct and good, rather than incorrect. I do get annoyed if someone "corrects" my answer and makes it worse but making it better, I'm not so bothered. – ben is uǝq backwards Jul 13 '13 at 11:49
  • 2
    There's some ambiguity here. The "don't edit code" rule is there to knee-jerk reviews of edits by low-rep users. An edit by a subject expert with lots of rep doesn't need to be reviewed. Applying that rule to an edit by such a user, one that clearly improves the answer, just doesn't make sense and won't be appreciated. No need to worry much about the downvoters either, they can revert their vote after the edit and get their rep back. There's just no down-side to leaving the edit in place. – Uphill Luge Jul 13 '13 at 16:51
  • Fair enough. :-) I stand corrected. Appreciate the feedback. – Ken White Jul 13 '13 at 19:52

There are (at least) two things you can do when you see a bad answer:

  • You can edit it, and make it better
  • You can post your own competing answer.

Which one you do is entirely up to you.

For questions, changes to code should be limited to non-breaking changes: The state of the code before and after the edit should be the same (otherwise, you may accidentally fix the OP's issue through editing, which makes it an invalid question).

For answers, there's no such limitation. It's all based on whether you want the reputation or not.

If a question has an already accepted answer that's invalid, you can either post your own answer or improve the accepted answer. Which path you choose is again up to you, but you should take into account the number of competing answers and the likelihood new visitors to that question will even see your answer.

Funny thing, during all this hullabaloo over the answer, no one improved the question.

  • Not sure if the question can be improved. It kind of has that "please send me the code, good sir" vibe. – Old Checkmark Jul 13 '13 at 13:09
  • I edited it so that at least it has a searchable air to it; that way someone will be able to at least find that really good answer attached to it. But yea, I also closed it as needing a minimal understanding of the problem. – George Stocker Jul 13 '13 at 13:10
  • 4
    I would add a third option to the list, one that I actually prefer: leave the comment below the answer, and only edit if the original answerer doesn't respond. This is the preferred way to go when the answer is very recent. – John Dvorak Jul 13 '13 at 15:46
  • 1
    @JanDvorak Been there, tried that. Doesn't always work out well. – George Stocker Jul 13 '13 at 19:45
  • Thanks. I appreciate the feedback. I prefer @JanDvorak's solution (which is what I usually do when a new user posts a flawed answer, and then wait for a considerable time before downvoting to allow them a chance to correct it), though. :-) – Ken White Jul 13 '13 at 19:54

You must log in to answer this question.

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