This question is a terrific mess. The question itself seems to me clearly off-topic due to being a snippet and the OP graciously agreed in the comments; but in the meantime it has attracted answers of wildly varying quality - some that are effectively wrong, and some that are thoughtful and accurate. The answers and question are not out-of-sync, but the question needs editing to be on-topic and such edits probably would bring it out-of-sync. The best answer has now been accepted, but that doesn't really resolve these issues.

What do we do with the question, and what do we do with its answers?

  • \$\begingroup\$ When I posted an answer to the question, it had already received a bad answer (since deleted). I improved the question, downvoted the bad answer, and posted a better answer partly to demonstrate to the original answerer a better way to help the OP. I'm more than willing to delete my answer, and allow the question to be closed/deleted as off-topic. \$\endgroup\$
    – AJNeufeld
    Apr 29, 2020 at 17:24
  • \$\begingroup\$ Given the explanation from @Peilonrayz I do not think that deleting your answer is appropriate - it's good; it's been upvoted by multiple people, presumably including the OP; and the OP has accepted it. \$\endgroup\$
    – Reinderien
    Apr 29, 2020 at 17:26
  • \$\begingroup\$ @Reinderien FWIW I normally start a VTD/flag on answers to off-topic questions. \$\endgroup\$
    – Peilonrayz Mod
    Apr 29, 2020 at 17:26

2 Answers 2


Firstly if you think a question is off topic there are two very important things to do:

  1. Put the question in the review queue.

  2. Comment on the post.

    This allows other people to see things from your perspective. Allowing others to see something they potentially missed when viewing the post. And helps the OP as then they can aim to improve their question.

By not voting to close the post you've limited how many people with the VTC privilege view the post and can handle it.

After the question has exited the review queue it will either be determined to be on or off topic.

  • On-topic: If you find any of the posts to be good then vote them up. If you find most of them to be "effectively wrong" then you may want to post your own answer.

    Obviously if you think the question is off-topic for a reason that can cause undesirable backlash, then please avoid answering it.

    For example, if you think there is not enough context then posting an answer can result in a backlash. The OP may become argumentative and hostile about your answer saying that their real code isn't like the one in the question.

  • Off-topic: Then the OP should edit their post regardless of whether there are answers.

    It is common for users to downvote any answers, as otherwise we're condoning undesirable behaviour. Behaviour that will slowly rot away the quality of the site. Additionally flagging as NAA or starting a vote to delete may be some actions users wish to take.

    [14 ...] Invalid answers on off-topic questions in the process of collecting close votes should be downvoted without blinking, and hopefully removed too. If the question is edited into shape, IMO invalid answers are NAA. – Mathieu Guindon♦ Oct 28 '16 at 1:24

  • \$\begingroup\$ Re. flagging: I guess the reason in this case would be "in need of moderator intervention"? There is no option to close; I have already VTC. \$\endgroup\$
    – Reinderien
    Apr 29, 2020 at 17:16
  • \$\begingroup\$ @Reinderien I think I need to reword that, I believe that the option to flag is only available from 15 - 3k rep \$\endgroup\$
    – Peilonrayz Mod
    Apr 29, 2020 at 17:23
  • \$\begingroup\$ @Reinderien If you can vote to close, you lose a couple of flagging options. That's by design. \$\endgroup\$
    – Mast Mod
    Apr 29, 2020 at 17:28
  • \$\begingroup\$ "It is common for users to downvote any answers, as otherwise we're condoning undesirable behaviour. Behaviour that will slowly rot away the quality of the site." I'm glad this isn't Stack Overflow. There are plenty of objectively bad answers there by people who just care about their reputation. \$\endgroup\$
    – S.S. Anne
    May 2, 2020 at 20:36
  • \$\begingroup\$ @S.S.Anne After seeing that on SO, I've started to see it more on CR. :( We can try fend it off but I'm sure as the site gets larger we'll have to capitulate to the masses. \$\endgroup\$
    – Peilonrayz Mod
    May 3, 2020 at 2:03

I agree with Peilonrayz' answer.

Another thing you can consider is to comment on the answers in an effort to discourage answers to off-topic questions.

I have seen the comments below and added them to my forked list of auto-comments - feel free to use them if you use the auto-comments:

[A] don't answer off-topic questions

Please note, questions involving code that's not working as intended, are off-topic on this site. If OP edits their post to address the problem and make their post on-topic, they make your answer moot. It is advised not to answer such questions. Protip: There are tons of on-topic questions to answer; you'll make more reputation faster if you review code in questions that will get higher view counts for being on-topic.

[A] don't answer questions likely to be closed

Please refrain from answering questions that are likely to get closed.

Sometimes I alter those depending on the way the post is off-topic...

  • \$\begingroup\$ Obligatory link to Code Review's auto comments meta \$\endgroup\$
    – Peilonrayz Mod
    Apr 29, 2020 at 18:51
  • \$\begingroup\$ I know that on Stack Overflow this can cause retaliation and/or people blaming you for downvoting their answers. I hope that doesn't happen here. \$\endgroup\$
    – S.S. Anne
    May 2, 2020 at 20:38

You must log in to answer this question.

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