The Stack Overflow podcast is back! Listen to an interview with our new CEO.
141

You have several options for follow-ups: Accepting an answer If one of the answers gives you good advice with clear directions for improving your code, just accept the best answer and upvote any other answers you feel were helpful. The checkmark that you confer is the best way to show appreciation on this site, as it gives 15 reputation points and raises ...


22

Answers to off-topic questions are already invalid One way to look at this is to say that if a question is invalid, it should be closed and not answered. Answering an invalid question sends exactly the wrong message and encourages unwanted behavior. Following that line of reasoning, fixing the question to make it on topic doesn't invalidate any answer ...


15

We should just leave them alone There is no good solution to these mixed-bag questions with code in varying states. If there was an easy solution, we would have done it already. As it stands, my recommendation is that we just leave these things alone, and 'grandfather' the mess. New questions are held to the exacting requirements of 'no code changes after ...


13

As @200_success has mentioned, flagging was justified. Had you reverted again, then the OP may have done the same, starting a rollback war. Never try to engage in a rollback war. If one ever occurs, whether or not you're involved, wait for a moderator to lock the post, preventing further edits.


13

Flagging it for moderator attention was justified. Thanks for your vigilance and for doing your part to keep the review process fair. I've reminded the user of the rule and closed the question as "Unclear what you are asking." If the author of the question reverts it to a state that it was in before the first answer was posted, we may consider reopening ...


11

I used to place a comment on an answer of an off-topic question, stating that the answerer should refuse to answer off topic questions. Sometimes this went well and the answerer removed his/her answer, but mostly the comment just stood there with no action taken by the answerer, so I stopped doing this. But this doesn't answer your question... Our ...


8

Cautiously editing any part might not a good idea. Someone might have copied your code and studying in their IDE. That is what I usually do instead of reading online. That could lead to confusion. A note in the question might not be enough.


8

Hypothetical situation: OP asks a question involving broken code. Question starts collecting comments asking to clarify or explaining what's wrong with the question; down and close votes rain, too. Someone posts an answer that fixes OP's bug. And then the question collects its 5th close vote, and sits there collecting dust in a broken state, and OP can't ...


8

Lock the question as soon as it is answered. Sound a bit too drastic. Locking is a moderator tool with good reason. For one the lock mechanism implemented by SE currently only allows completely locking a post, which would preclude any subsequent answers. As it currently stands this is not feasible, especially since there are valid reasons for editing a ...


7

No the question should stay as it is, because not only would this edit invalidate two answers (first, second) but I think we would send the wrong signals as well. It would look like it could be allowed to invalidate answers if one just asks an answerer of the question if he/she is ok with it. This could lead to extensive comments and could weaken the ...


6

A rollback is a dangerous option and should always be considered carefully. And yes, I've screwed this up myself at least once, so don't beat-up yourself too much about it either. The entire point of a rollback is to prevent a question and answer being out-of-sync. So, a rollback causing this, is not a good situation. Does the question need to be rolled ...


6

Modifying the question to incorporate suggestions from answers is called answer-invalidation. Doing that on any Stack Exchange site is considered to be an abuse of editing privileges. In addition, Code Review also forbids appending improved versions of the code to the question, to prevent confusion about what is being asked. Our standard response to these ...


6

First I'd like to apologies that you've been put in this horrible situation. Whilst your code was off-topic to start off with, you've tried many ways to get the question to be on-topic. Mostly to be shot down because you supposedly answer invalidated. This is unfair on you, as someone else broke our rules. But you're the one to be punished. This is not the ...


5

The first consideration is, is the code broken in a way that makes it off-topic? It's only off-topic if the question asks for help to fix a bug (or if it looks like the author is unfairly feigning ignorance by not even bothering to test for obvious bugs). Corner case failures do not make the question off-topic, and should be addressed in answers. It does ...


5

Let me quote the answer to which @Mast posted a link in his answer: Answers to off-topic questions are already invalid One way to look at this is to say that if a question is invalid, it should be closed and not answered. Answering an invalid question sends exactly the wrong message and encourages unwanted behavior. Following that line of ...


4

The one time to revise code after receiving an answer is if advice is given in a comment. Unlike answers, comments are temporary and do not have to remain. If you find something yourself and would like to point it out, even if it's a bug fix, it would be better to post it as a self-answer. It is okay to review your own code; it is not at all discouraged. ...


4

Code must not be edited after an answer has been posted Code must not be edited after an answer has been posted even if the answer is still valid after edit. Help Center states However, any aspect of the code posted is fair game for feedback and criticism. And answerer can edit his/her answer to include anything, anytime. And if the code has been ...


3

I came here because of The moderators have had a discussion, and we are proposing new guidelines for posting follow-up code. Specifically, we would like to end the practice of letting the OP append revised code to a question. Since this is a departure from past practice, please read and provide feedback. We plan to upgrade this to faq status soon. I ...


3

It happens regularly that the code in the post is broken (or otherwise not ready for review), but the problem is too complex to explain or demonstrate in the limited space afforded by a comment, and needs to be posted as an answer. Here's an example from earlier today, here's another from a week ago, here's a third with a detailed explanation of how to ...


2

The code in question, although you state it is your code and you maintain it and you have added enough context, is too much obfuscated. In its current form it just looks too much like example code because of all the "things". If you would have used different names like device instead of thing the code would speak for itself and one wouldn't need to read ...


1

Why do you need to come to meta? In this case both parties involved are ok with it. Let them edit their posts however they want. Surely we don't need a rule that says: If an answerer agrees and removes part of their answer that an OP wants to change, then the OP can answer invalidate the older revision of the post. If you actually think about it, that'...


1

Note: By time of posting of this meta question, the question in question wasn't closed yet. It is now. Should we evaluate it on a case by case basis? To the best of my knowledge, that's how it currently goes. Whether we should, well, it's a messy business which I'll attempt to explain later on. So I'm not sure it's avoidable. We simply can't fit every ...


Only top voted, non community-wiki answers of a minimum length are eligible