# Why is code that is not explicitly part of a working project not appropriate? [duplicate]

I recently saw this question, which is a perfectly reasonably question about how to make code more efficient, but it was put on hold for being off topic. I see this all the time - someone wants to review something very specific that doesn't require an entire project surrounding it to ask, and it gets put on hold for being hypothetical.

The thing is, there is nowhere else to ask this question, and Code Review is almost certainly the best place for it. And now even though I might want to answer this guy's question, which is even useful to future browsers, I cannot.

The gist of this question is 'What is better in this case, map or inject'. In what universe is that not a question for Code Review? We are reviewing two (short) pieces of code and determining which is better.

Why is this rule in place? Off the top of my head I can't think of any questions that so desperately need to be part of real code that to ask them without a surrounding project is worthy of being closed. This is a question and answer site; let people ask questions.

• Even thought the comments on the closed question don't point it out specifically, the close reason is also: we don't review other people's code. The 'other' code in the question was not written by the question asker. – rolfl Feb 17 '15 at 14:10

This is more of a question for StackOverflow (it's not asking for code to be reviewed), however it'd get shut down on StackOverflow as being too broad or too subjective, so in reality there isn't anywhere on the SE network to put it.

You may want to review "My question was closed as being off-topic. What are my options?" to see what Code Review allows/doesn't allow.

• I think it seems fairly clear that the user is asking which method is more efficient, which is a goal of a lot of CR questions. – Devon Parsons Feb 17 '15 at 14:04
• Yeah according to this: meta.codereview.stackexchange.com/questions/1942/…, the questions shouldn't have been closed – Brandon Wamboldt Feb 17 '15 at 14:06
• If you want to know which horse is faster, why have an opinion based debate about horse speeds instead of just taking them to the track and racing them? – nhgrif Feb 17 '15 at 14:06
• @BrandonWamboldt: The question referenced in that Meta question is quite different than this one, and is more on-topic. Not all comparison questions are allowed. – Jamal Feb 17 '15 at 14:08
• @nhgrif while I get your point, in a less trivial example things like code readability/maintainability also need to be taken into context. – Devon Parsons Feb 17 '15 at 14:11
• @Jamal What is the criteria for whether or not a comparison question is allowed? – Devon Parsons Feb 17 '15 at 14:12
• @DevonParsons: It must be, first and foremost, the OP's code. This question had some other code presented as well. It must also not be stripped of context for the sake of simplification (we don't like placeholder names applied just for us). On-topic questions likely don't attract general debates that you already find on other sites. – Jamal Feb 17 '15 at 14:14
• @Jamal I agree with that. Nevertheless OP is here asking this question; it might as well be his code, because he wants an answer. I understand why it's closed, it just irks me that he has a question, I have an answer, and we don't get to share that because of some subjectiveness. – Devon Parsons Feb 17 '15 at 15:01
• @DevonParsons: That's how SE works as a whole, not just CR. We're not a free-for-all, and not every question does well on the network. – Jamal Feb 17 '15 at 15:05
• The disallowal of subjective questions & answers is a large part of what keeps the StackExchange so high quality. – nhgrif Feb 17 '15 at 15:06