I answered this question this morning on code review, mainly because I had the idea there were some things that could be good for a code review, however the code that was given wasn't working as intended by the OP.

I tried to clarify the problem for him as much as possible, however, I also realized that I should probably not have reviewed the question in the end either.

Should I remove the review? I already flagged the question as off-topic as well, as the code is not working as intended.

  • \$\begingroup\$ See: codereview.meta.stackexchange.com/questions/6604/… \$\endgroup\$ – Heslacher Aug 7 '17 at 9:00
  • \$\begingroup\$ @Heslacher true, however, I didn't reply it as an so post, but rather as a review with lots more explanations than I would do on stackoverflow for example, so my question would maybe be more like, is an ontopic review of an off-topic question ok? \$\endgroup\$ – Icepickle Aug 7 '17 at 9:08
  • \$\begingroup\$ Usually its seen here that an off-topc question will make answers off topic as well. \$\endgroup\$ – Heslacher Aug 7 '17 at 9:09
  • 3
    \$\begingroup\$ I just happened to act on this post. It was accepted just now, preventing you from removing your answer, so I'll just remove the entire question. I appreciate you thinking this over and realizing that there was something wrong with the question. This does happen with others from time to time. \$\endgroup\$ – Jamal Aug 7 '17 at 9:30
  • \$\begingroup\$ @Jamal I disagree about removing the question. Let the answer stay and let it give some value. The question is already marked as off-topic, no need to delete it. Especially not by a moderator, in which case it cannot be undeleted. \$\endgroup\$ – Simon Forsberg Aug 7 '17 at 9:32
  • \$\begingroup\$ @SimonForsberg: How about migrating it instead? \$\endgroup\$ – Jamal Aug 7 '17 at 9:34
  • \$\begingroup\$ @Jamal The current answer is not a good Stack Overflow answer but a good CR answer. I propose we just leave the question closed and answer as-is. \$\endgroup\$ – Simon Forsberg Aug 7 '17 at 9:36
  • \$\begingroup\$ I left a comment on that post instead, so hopefully the OP will keep it on SO next time (they already have some rep on there, too). \$\endgroup\$ – Jamal Aug 7 '17 at 9:43
  • \$\begingroup\$ @Jamal and he seems to be aware of that, he has an earlier version of the question online here. \$\endgroup\$ – Icepickle Aug 7 '17 at 9:55
  • \$\begingroup\$ I already asked an SO mod about that. I actually didn't notice that question before (you did leave the wrong link, but I found the relevant question on SO). Perhaps another mod can take a look at this. \$\endgroup\$ – Jamal Aug 7 '17 at 9:59
  • \$\begingroup\$ Oh, you are right, I ment this question \$\endgroup\$ – Icepickle Aug 7 '17 at 10:00
  • \$\begingroup\$ @Icepickle I see no indication that the OP is/was aware of any of those older questions? \$\endgroup\$ – Simon Forsberg Aug 7 '17 at 10:29
  • \$\begingroup\$ @SimonForsberg It is linked to his account, or how do you mean your statement? If you are referring to me as OP, yeah, I didn't know it before Jamal mentioned that he also had an SO account ;) \$\endgroup\$ – Icepickle Aug 7 '17 at 10:32

From the description of the question, I think it was quite clear that the code doesn't work as intended. As such, the code was not ready for review here, and the question was likely to get closed. In such case, users should not post an answer, but vote/flag to close instead. Even if you think you can teach valuable lessons. The question is just not ready. You can always teach valuable lessons after OP whips it in shape.

You did answer it, so now what. You have put work in that answer and I'd hate to see that wasted. So I don't think it should be removed. If it gets cleaned up by the system at some point, for example due to many downvotes or something, so be it. But I don't think we should take an explicit action right now.

The ideal outcome might be the OP fixing his problem, and making the minimum amount of changes to the question to bring it on-topic, and without invalidating too much of your answer. But that may never happen. Or the code may not be fixable without invalidating substantial parts of your answer. Too bad then, and this is precisely why you should not review code that's not ready.

  • 3
    \$\begingroup\$ Unless the OP unchecks that answer, it won't get cleaned up by the system, unfortunately. I'm at least glad the answerer realized his mistake and would likely be more careful in the future. \$\endgroup\$ – Jamal Aug 7 '17 at 11:23
  • \$\begingroup\$ I personally think this answer fits the best for me :) Though the other ones are good as well, I will check it from time to time and in case the OP does decide to edit his question, then I will try to act upon the changes instead :) \$\endgroup\$ – Icepickle Aug 9 '17 at 9:47

IMO you should remove your answer which now isn't possible anymore. Keeping answers to off-topic questions will lead to more off-topic questions.

New users who will look at the question seeing it has an answer will think "Althought I only have broken code the chances are high to get an answer."

In addition I would like to notice that we had a consens last year about what should happen to answers to off-topic questions.

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 because any answers were already invalid.


  • 1
    \$\begingroup\$ I actually believe I could edit it, to make it a on-topic which would only require small changes to my answer as well, like leaving out the first 2 paragraphs, should I do that rather? \$\endgroup\$ – Icepickle Aug 7 '17 at 12:34
  • 1
    \$\begingroup\$ IMO thats the OP's job otherwise it would send the same message. \$\endgroup\$ – Heslacher Aug 7 '17 at 12:35
  • 1
    \$\begingroup\$ @Icepickle aside from sending the wrong message to OP, it's highly dangerous to start editing OPs posts to make them on-topic. It's basically not how things work around here... \$\endgroup\$ – Vogel612 Aug 7 '17 at 12:36
  • 1
    \$\begingroup\$ @Vogel612 Okay, it's just that the only broken code he had was 1 missing parameter and 1 assignment index property was missing, to make it on-topic (meaning, his test would have been correct, and most of my suggestions would still hold true). But they are both good points you guys make, I could potentially give it as a remark to the question, instead of editing it... \$\endgroup\$ – Icepickle Aug 7 '17 at 12:38

What good can come of removing your answer now? Some would say that it's to make a statement that off-topic questions shouldn't be answered.

Off-topic questions shouldn't be answered no, but if it gets answered, I see no point in removing the answer. The question is marked as off-topic so no more answers can come. Deleting the answer now would just remove the value that it has given. I think you should let the answer stay.

  • 2
    \$\begingroup\$ Three down-votes and no comments as to why? And no counter arguments? \$\endgroup\$ – Simon Forsberg Aug 7 '17 at 10:31
  • \$\begingroup\$ I would be curious about the reason for down votes as well \$\endgroup\$ – Icepickle Aug 7 '17 at 10:34
  • 4
    \$\begingroup\$ @SimonForsberg usually on meta dv means that someone dosn't agree so I usually don't leave a comment for such a case but I now posted an answer. \$\endgroup\$ – Heslacher Aug 7 '17 at 12:18
  • 1
    \$\begingroup\$ Clearly off-topic questions shouldn't be answered no, but if it gets answered then the answer encourages other people to answer off-topic questions because it looks as if it was ok after all so the vicious circle keeps turning... \$\endgroup\$ – t3chb0t Aug 13 '17 at 16:59

You must log in to answer this question.

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