3
\$\begingroup\$

I posted some useful code on code review.

One of the answers suggested an improvement to the code.

I agreed and made the improvement to the code, and left the comment "Thanks, fixed".

A moderator than rolled back the change.

This is utterly stupid. For posterity the code should be kept in the best state.

If this is the policy, that bugs should be kept in the code, it should be changed immediately. It's far more important that people searching for the code find the best version to copy-and-paste, than it is to know the history of the changes.

If they want to find the history that can look at the revisions, or simply reverse the answers.

If this policy isn't changed, I simply won't use this site anymore.

\$\endgroup\$
6
  • \$\begingroup\$ Code in question: codereview.stackexchange.com/questions/20058/a-c11-any-class \$\endgroup\$ Nov 21, 2013 at 17:37
  • 4
    \$\begingroup\$ Mootinizing answers with major edits is a no-no on all SE sites, including SO. \$\endgroup\$ Nov 21, 2013 at 17:44
  • \$\begingroup\$ @retailcoder: That doesn't work on Code Review obviously. Integrating the answers into the code for review should be actively encouraged. \$\endgroup\$ Nov 21, 2013 at 17:46
  • 2
    \$\begingroup\$ I upvoted this not because I agree, but because it is important that people know what is and what is not the site-policy. \$\endgroup\$ Nov 21, 2013 at 18:31
  • 1
    \$\begingroup\$ meta.stackoverflow.com/users/153001/tcpman-exe (formerly known as Mootinator) - I guess the correct word was "Mootinate"... whatever. \$\endgroup\$ Nov 21, 2013 at 18:42
  • 1
    \$\begingroup\$ I actually agree with user1131146. Personally, I would rather see the fully most accurate version of the code in the original section, instead of having to go through the comments to see if there were updates. One way might be to add an 'Applied' button flag to indicate the the OP has applied the feedback from a particular response. This way, the person giving the feedback still gets credit and people reading the section will see that they don't have to make further edits to the original post. I don't see that there's a downside to this approach.. \$\endgroup\$
    – Gino
    Mar 7, 2016 at 12:14

5 Answers 5

9
\$\begingroup\$

I'm afraid that I have to agree with the rollback. Invalidating answers by editing the question is not acceptable on any SE site as far as I know. This also applies for Code Review.

Since many questions on Code Review contain a lot of code (which is perfectly OK), we encourage multiple answers to questions. One answer does not need to address all problems in the original question.

As the answer already has been posted, when you update the question the answer isn't useful anymore. That is what we want to avoid. The answerer still deserves the upvotes for the answer that he posted.

On the question you commented "If an answer is integrated than the answer should be deleted." We don't want to delete good answers If we would, then all existing answered questions could be updated (and their answers deleted) with the fixes the answers suggest included. That would make this site useless, as you wouldn't be able to see the change from how the code used to look to how it should look. Code Review is the process of improving code, not about being a site to store the best possible version of code (there's GitHub for that).

I would like to propose possible solutions to you:

  • Un-mark the answer as accepted, as it seems like you are looking for more answers than this.
  • Post a new question, with the updated version of the code.
  • Add a bounty to your question, stating that you want additional reviews.
\$\endgroup\$
5
\$\begingroup\$

To mootinize: to render moot

In American law, a matter is moot if further legal proceedings with regard to it can have no effect, or events have placed it beyond the reach of the law. Thereby the matter has been deprived of practical significance or rendered purely academic.

Despite my upvote on this legitimate and well-asked [and heart-felt!] question, I disagree. On CR the questions contain working code and the answers contain recommentations.

If the OP decides to apply the proposed changes in the originally posted code, then the recommendations don't stand anymore and answers that lead to writing the better code become useless.

For another reviewer to find something to say about the code, they need to browse the edit history to dig up the code other answers are referring to.

If the OP decides to apply the proposed changes in their IDE, then they have a new version of the code and if they want it reviewed they can post another CR question.

\$\endgroup\$
3
\$\begingroup\$

you should have posted a new question if you want the most current code posted at all times, this is acceptable, in my opinion.

when you changed your code on the question to match what the answerer posted, then his answer because obsolete and didn't make any sense. someone coming in from a search engine wouldn't know the difference coming to this site and would be rather confused.

that is the reason for the rollback

Listen to Moderator Comments

\$\endgroup\$
5
  • 1
    \$\begingroup\$ There was a comment under his answer "Fixed". Someone coming to the site will be able to figure out his answer is integrated. Creating a new post for each change is downright wrong. \$\endgroup\$ Nov 21, 2013 at 17:47
  • 1
    \$\begingroup\$ No, all he does is explain the current idiotic policy. Who wants to go searching for broken code? The whole site makes no sense with this policy. The correct policy is to encourage people to update their code with the answers, so the code is in the best state when found by others (of course). Unbelievable. \$\endgroup\$ Nov 21, 2013 at 17:51
  • 4
    \$\begingroup\$ @AndrewTomazos The better version of the code should be in the answers, not in the question. \$\endgroup\$ Nov 21, 2013 at 17:58
  • 6
    \$\begingroup\$ @AndrewTomazos The point of this site isn't a Cut-and-Paste code collection, it's the code review itself. The original code (with all of its context) is kind of important in a code review. Editing your question is the equivalent of my taking a CS-101 student's broken program, fixing it, and giving them back only the FIXED copy of the code and a grade: the student loses the context of the changes and the benefit of seeing my red circle and explanatory notes in the margin to study from. \$\endgroup\$
    – voretaq7
    Nov 21, 2013 at 17:58
  • \$\begingroup\$ eventually the code that is in the question will be perfect and no one will find anything to review, thus no accepted answers.... \$\endgroup\$
    – Malachi Mod
    Nov 21, 2013 at 17:58
2
\$\begingroup\$

I'll keep my general argument here since I will eventually scrub those comments.

First, please observe this portion of the FAQ:

I'm confused! What questions are on-topic for this site?

Simply ask yourself the following questions. To be on-topic the answer must be yes to all questions:

  1. Does my question contain code? (Please include the code in the question, not a link to it)
  2. Did I write that code?
  3. Is it actual code from a project rather than pseudo-code or example code?
  4. Do I want the code to be good code, (i.e. not code-golfing, obfuscation, or similar)
  5. To the best of my knowledge, does the code work?
  6. Do I want feedback about any or all facets of the code?

Point #5 suggests that if you first present your code without knowing about bugs beforehand, you may ask the question. This is different from SO in that answers primarily revolve around fixing bugs found by the OP. Here, code is not automatically off-topic if bugs are found afterwards.

Your question suggests no awareness of bugs. Overall, your question is on-topic. Someone eventually found bugs which, again, is okay here. As this answer is justified in accordance to the FAQ, it can remain. On the flip side, had you been aware of this bug, and someone fixed it anyway, that answer could be justifiably converted to a comment. But that doesn't apply here.

Overall, answer invalidation is never okay if the answer can justifiably remain. This is an SE-wide policy as answers are considered "permanent." It doesn't matter if visitors want the best code. Even then, that doesn't make sense in regards to reviewing. Code will almost always contain flaws. Do you want visitors to copy-paste working, but poor code? If it didn't matter, then answers could just be thrown away at a whim if the OP modifies the code. Sure, comments are fair game, but not valid answers.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ The code worked fine before and after the change. The change is just to remove some redundancy. But all of that is completely irrelevant (whether a bug or a feature). The code should be presented in the best state, keeping answers relevant is completely secondary for a site like this. I simply won't publish my code to this site anymore. \$\endgroup\$ Nov 21, 2013 at 17:57
  • 1
    \$\begingroup\$ @AndrewTomazos: I've already discussed this with other moderators, and they agree as well. Besides, you've already received some feedback on your code, which is what you came here for. I'm merely upholding the rules while not interfering with the feedback you receive from others. \$\endgroup\$
    – Jamal
    Nov 21, 2013 at 18:01
0
\$\begingroup\$

The only time that you should change your code is if you made a typo and someone caught it and told you, usually they will notice this is a typo and mention it in a comment, that is the only time that you should change the code, not if it was written wrong, or poorly and you didn't have it that way when you started.

if the answer is continually changed with every review then what happens is
eventually the code that is in the question will be perfect and no one will find anything to review, thus no accepted answers.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This answer looks like it's a comment... :p \$\endgroup\$ Nov 21, 2013 at 18:07
  • \$\begingroup\$ @retailcoder, on the original question maybe. it does look short enough doesn't it? \$\endgroup\$
    – Malachi Mod
    Nov 21, 2013 at 18:13

You must log in to answer this question.

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