10

A moderator deleted my answer on Stack Overflow that fixed a bug in the accepted answer. My response to the moderator's comments are below:

Moderator: "This is more or less an exact duplicate of the accepted answer."

Response: The "more" and "less" fixed 3 bugs that prevented the cron job spec from running on my system (a common 10.04 Ubuntu server environment).

Moderator: "I'd go and find some newer and unanswered things to provide answers to. Thanks."

Response: I'd Googled to find this question without filtering in google for page update date. The answer pointed me in the right direction, but the bugs mentioned above caused me an hour of debugging headaches--and it's not just my ignorance that caused me to flounder, cron job specs are notoriously difficult to debug and git syntax is notoriously finicky. I thought I'd save future SO users from the same headache.

Could my answer be undeleted, as it clarifies the original, accepted answer, and if not, why?

26
  • 5
    You should have suggested an edit to the existing answer, explaining your fixes. Failing that, you should have explained, in detail, what makes it different.
    – Oded
    Jul 12, 2012 at 17:42
  • 7
    "Hopefully the moderator wasn't trying to stifle debugging of old code but intended to prompt me (and others) to learn how to use meta to protest." - I don't think he was doing either. He was, more than likely, responding to flags on your answer. Jul 12, 2012 at 17:43
  • 4
    I think suggested edit is appropriate for this case. However, I can imagine that such suggested edit has high rate of getting reject - since not everyone can have perfect environment to cross check the validity of the edit.
    – nhahtdh
    Jul 12, 2012 at 17:43
  • Ahh. Now I get it. Will suggest the edits.
    – hobs
    Jul 12, 2012 at 17:46
  • At least, you should have - and still should before a possible undeletion - explained in the answer what bugs (?) in the accepted answer that fixes and how. Jul 12, 2012 at 17:46
  • 10
    Please don't suggest code edits to an accepted answer.
    – user102937
    Jul 12, 2012 at 17:46
  • Except possibly minimal syntax fixes (a forgotten ';' or so). Jul 12, 2012 at 17:47
  • 2
    I wouldn't say edit the existing code, but add an additional code sample and explain what bugs in the original code sample it might help overcome (even though it seemed to work for the person who accepted the answer).
    – Aaron Bertrand Staff
    Jul 12, 2012 at 17:47
  • I don't think making code edits to another answer, especially an accepted one, are a good way to go. Instead I'd make a separate answer explaining why you changed the code
    – Ben Brocka
    Jul 12, 2012 at 17:47
  • 1
    @AaronBertrand: A clarifying comment on the accepted answer is a better way to go here.
    – user102937
    Jul 12, 2012 at 17:49
  • 1
    The deleted answer doesn't really add anything, since there is no explanation of the bugs or how the new code fixes them. See @JeffAtwood 's answer below.
    – user102937
    Jul 12, 2012 at 17:52
  • 2
    @BenBrocka which poster? The one who asked the question, or the one who posted the answer you're correcting? The original poster is not the primary person who will benefit in this case IMHO. They accepted the answer long ago so either it worked out of the box or they dealt with the bugs and fixed them on their own. Editing the accepted answer helps other readers, regardless of whether the asker or the person who posted the answer you've fixed know you've done anything.
    – Aaron Bertrand Staff
    Jul 12, 2012 at 17:57
  • 1
    FYI: Saying an answer is legit doesn't make it legit.
    – casperOne
    Jul 12, 2012 at 18:07
  • 2
    @AaronBertrand: I know that people are used to working in Source Control systems where everyone owns the code and nobody owns the code, but have a little respect for the original author. If you have better code with a useful explanation, post it as your own answer, but don't change other people's code unless it's simple and obvious syntax fixes that anyone can verify.
    – user102937
    Jul 12, 2012 at 18:07
  • 1
    @RobertHarvey I understand that, but on an old question with an existing accepted answer that has potential problems that seemed to go unnoticed at the time, what are the odds your independent answer is going to get any attention from anyone? And once again, I did not say to change anyone's code. I suggested adding an additional code sample and explaining the differences.
    – Aaron Bertrand Staff
    Jul 12, 2012 at 18:10

2 Answers 2

13

If you're going to post another answer, you owe it to the readers to explain at least briefly how your answer differs from the existing answer(s). "Fixed a couple of errors" - uh, what errors? If I'm already using the existing answer, I'd kinda like to know what errors I'm missing. As Jeff notes, leaving a comment on the existing answer would help others - including the person who wrote the answer - understand the problem. Posting a separate answer with no explanation won't.

If it's something specific to your situation, something that isn't useful (or is actively harmful) to folks in other situations, then tell us what situation this answer is good in.

I'll be happy to undelete your answer, as I'm sure would any of the SO moderators, but first please make it useful by explaining when and where it should be used.

4
  • Yep. Should have been more thorough with my answer.
    – hobs
    Jul 12, 2012 at 17:55
  • My comments to the accepted answer included a brief description of the bugs, as I understood them at the time.
    – hobs
    Jul 12, 2012 at 17:58
  • You added that comment long after your answer was deleted; IMHO, it's probably fine left as a comment, but if you want to expand on it and elaborate on when / why it's needed in your answer, go ahead.
    – Shog9
    Jul 12, 2012 at 18:00
  • Yep, my initial comment was something like "doesn't work for me". When I fixed the bug I didn't bother to figure out how/why, and just posted what I had, so I could get back to paid work. Then the delete came and that prompted me to question my code and try to figure out the right way to use SO and communicate changes. I'd previously thought brevity was valued over explicit detail. Now I know better.
    – hobs
    Jul 12, 2012 at 18:05
20

Well, let's look at what your answer was:

Original:

*/1 * * * * su -s /bin/sh nobody -c 'cd ~dstrt/www && /usr/local/bin/git -q pull origin master' 

Yours:

*/1 * * * * su -s /bin/sh nobody -c 'cd /home/hobs/src/project && /usr/bin/git pull origin master'

This corrects a couple errors that prevented the accepted answer from working on my system.

What is the actual difference there? Normalizing for the command and the paths, I see exactly one difference:

-q

Couldn't you have left that as a comment or an edit?

5
  • Didn't think of it in the flurry of debugging, and didn't diff the working line thoroughly enough. Even if I had, and tried a 2-char edit, SO system would have insisted I change more (I think).
    – hobs
    Jul 12, 2012 at 17:52
  • 8
    just leave a comment for a change that small. Jul 12, 2012 at 17:53
  • Is the "smallness" of a change measured in characters or correctness of code? What about the insidiousness of the error and the difficulty in discovering the correct code/syntax? Either way I provided the requested comment post-delete. Seems a 1-line answer at the bottom of the list wouldn't pollute the page that much (as long as I elaborated on the reasons and insidiousness, etc).
    – hobs
    Jul 12, 2012 at 18:10
  • 3
    @hobs I don't think it's about pollution at all, though only the mod who deleted the answer knows for sure. The answer was most certainly deleted because it was almost indistinguishable from the existing accepted answer, and didn't have any context explaining why it was posted in the first place, so what would make any reader pay any attention to it? The author who wrote the accepted answer might even think you were trying to one-up them if they, too, didn't see the minor difference in the code.
    – Aaron Bertrand Staff
    Jul 12, 2012 at 18:15
  • @Aaron. I assumed that readers seeing my comment that the accepted answer didn't work (and see errors on their system using the accepted code) might look further down the list for other answers, and mine might be one of the ones they consider. Yep, clarification would have been better. That seems to have been my main sin--ommitting a bug description and comments to calling attention to my answer.
    – hobs
    Jul 12, 2012 at 18:25

You must log in to answer this question.

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