You're on Stack Overflow and you've found a question that seems to be about improving code. You are trying to be helpful, and you put a comment in the question:

You should try asking on CodeReview.SE instead. —YourName 2 minutes ago

… and suddenly, out of nowhere CodeReview.SE users swoop in saying:

@YourName No, this isn't a good question for Code Review. —AnotherName 5 seconds ago

or they might say:

@YourName This could be a good question for Code Review, if (…) —AnotherName 5 seconds ago

Why are they saying that this isn't a good question, as it is, for Code Review? What is in scope on Code Review?

What should I look for when determining if a question should go on Code Review? And why do they sometimes seem to get so annoyed about the referral?

This question is Code Review's version of a similar question on Software Engineering Meta.

What distinguishes Code Review from Stack Overflow?

Different communities have different rules to address different needs. A quick summary:

$$ \begin{array}{l|l} \textrm{Code Review} & \textrm{Stack Overflow} \\ \hline \text{Open-ended questions} & \text{Questions with a specific goal} \\ \text{Answers can suggest any improvement} & \text{Must answer the question} \\ \text{Code must already work as intended} & \text{(No such requirement)} \\ \text{Prefers code in its “native habitat”} & \text{Prefers distilled examples} \\ \text{Code in question must be preserved verbatim}\quad & \text{Readability edits allowed} \\ \end{array} $$

What are the most important considerations?

  • Before referring a Stack Overflow user to Code Review, consider: Is it really off-topic for Stack Overflow? Just because a question is said to have "working code" and seems to be on-topic on Code Review, doesn't mean that it is automatically off-topic for Stack Overflow. There are many questions that are on-topic on both sites. The Stack Overflow Help Center doesn't say that code reviews are explicitly off-topic there, so don't migrate for the sake of migration.
  • Before posting a question on Code Review, read How do I ask a good question?, which covers the common reasons for questions being poorly received on Code Review.

Does the question title need to be changed?

Question titles for Stack Overflow are questions targeted towards achieving a specific outcome (e.g. Can I make this algorithm more time/memory efficient?), whereas all questions on Code Review have a single, implicit, general question, "What can be improved in this code?". So it's not useful for every question to be titled using some variant of "Please review my code", and the site standard is for the title to contain a summary description of the real-world problem that is solved by the posted code.

Complete advice in writing titles is in How to get the best value out of Code Review - When you ask your question.

Some commonly referred inappropriate questions

Please, we don't want the following kinds of questions: they will attract downvotes or close votes on Code Review, leading to frustration for everyone involved.

Questions where the code does not work as intended, or it's unclear whether or not it works

The most common reason for questions to be closed as off-topic on Code Review is that the code simply does not do what it is meant to do. Code Review is not about fixing bugs, and it is not a place to go for help adding a new feature to your program.

Questions asking "Does this code work?" or "Is this correct?" should be tested before being posted here. You should believe that your code works before you ask for a Code Review. There is a difference between asking "Does this code work?" (off-topic) and "This code works, how can I do it better?" (on-topic)

Questions with stub code, example code or pseudocode

Code that contains placeholders such as // do something, Foo/Bar, or someMethod() cannot be meaningfully reviewed. Hypothetical example code is off-topic for Code Review.

Unlike Stack Overflow, we prefer to look at real, complete code instead of example code or code that has been stripped of context for generality.

Questions with no code at all

Without code embedded directly within the question, we just cannot do a Code Review. We review Code and not unimplemented concepts.

If it seems like a question would belong on Code Review if the OP included their actual code, it is extremely important to point out that they need to include the code in their question.

Questions with insufficient context

A question that does not describe properly what the code does, while not immediately off-topic, is very likely to collect down-votes. To help reviewers give you better answers, Code Review questions should include a description of what the code does. The more you tell us about what your code does and the purpose of it, the easier it will be for reviewers to help you.

So what questions do you want?

  • Finished, working code that does what it is meant to do
  • Ideally, an asker willing to receive feedback on any aspect of the code

On all cross-posted questions, please add comments with mutual links. This helps everyone save time when triaging and answering questions.

So, why so upset?

Good referrals are genuinely appreciated. However, an inappropriate referral causes grief for everyone involved:

  • The original asker, cross-posting the question on Code Review, becomes puzzled or unhappy about receiving close votes or downvotes.
  • The close votes or downvotes make the Code Review community look hostile, when we are just doing our duty to inform the poster that the question is unanswerable.
  • The original asker may become frustrated that Code Review answers are "missing the point of the question", because on Code Review all questions are considered to be open-ended.
  • Stack Overflow looks unhelpful for giving someone the runaround instead of answering the question.
  • As long as we receive a significant number of inappropriate referrals, we cannot consider making Code Review a standard migration target on Stack Overflow.

Code Review has a much smaller community than Stack Overflow. We get about 30-40 questions per day. Stack Overflow gets about 8k questions per day. Even if a small fraction of Stack Overflow questions ends up being inappropriate referrals, the effort required to undo the damage imposes a large burden on the Code Review community.

What you should not do

Please do not vote to close with a custom reason that "it belongs on Code Review". Nothing in the Stack Overflow rules justifies such a custom reason, and sloppy reasoning perpetuates inappropriate referrals. Not all questions about analyzing code are off-topic on Stack Overflow, and not all code review requests are on-topic on Code Review. Instead, vote to close as too broad or primarily opinion-based.

We know that the GUI is misleading and we would like to do something about this. There are many occurrences of a Stack Overflow moderator saying the same thing. There is an active proposal to create a dedicated off-topic reason so that there is an intuitive process to close code review questions on Stack Overflow.

So, what can you do?

  • Think about if it's a good question for Code Review.
  • Flag it for migration if it is, and Include a reason why you believe the migration would be useful.. Help the mods out by explaining why you think it's off-topic for Stack Overflow and a good fit for Code Review.
  • If you find that it is off-topic for Stack Overflow vote to close as "primarily opinion-based" or "too broad"
  • If it's a really good question, ask in chat here for us to help it move along.
  • Avoid bouncing users from one site to another (and possibly having the question get closed on each).
  • Try answering good questions on this site to understand what we are looking for.
  • i already receive an answer, but i still feel some emptiness , so should i just go ahead and mark the first answer as answer without waiting for other, feeling it didn't answered all my question in my head? and please mention me, so i can find my answer. – deadManN Jun 16 '16 at 9:12
  • 1
    @deadManN This isn't related to the this meta question, but my advice is to either explain to the answerer why their answer isn't complete, offer a bounty, or create a new question if it's unrelated to your original question. There's no pressure to ever accept an answer if you don't want to. – 4castle Jul 11 '16 at 17:24
  • 2
    "Code must work as intended | (No such requirement)" -- If anything, the opposite requirement. In general, if you have working code on Stack Overflow, you're doing something wrong. – Nic Hartley Oct 19 '16 at 2:39
  • 3
    "Questions asking 'Does this code work?' or 'Is this correct?'" are off-topic on Stack Overflow too as they're a variant of "gimme teh codez" (or, in this case, "gimme teh test casez"), so these should just be downvoted and closed outright. As the tooltip for downvotes says, these questions "do not show any research effort; they are not clear or not useful." It's the OP's responsibility to test their code prior to posting, not to just dump it on the community and ask us to test it for them. – EJoshuaS Apr 21 '17 at 15:30
  • How do you actually flag for migration from SO to CR? Via custom moderator flag? – PM 77-1 Apr 25 '17 at 13:57
  • 1
    "The Stack Overflow Help Center doesn't say that code reviews are explicitly off-topic there." The code-review tag now says that code reviews are generally off-topic there. meta.stackoverflow.com/questions/278138/… – user135216 Oct 14 '17 at 16:55
  • "GUI is misleading" link broken. – 0112 Mar 14 at 17:29
  • This answer look rude to me. I feel patronizing. (But I agree) – Stargateur Apr 14 at 15:08
  • 1
    @Stargateur And your comment exemplifies why the "welcoming" blog is nonsense. The answer is merely stern. – jpmc26 May 7 at 23:52
  • Shameless self-promotion alert, but I have a Meta post on why "is this correct?" is OT: Why is “Is this correct?” an off topic question, and what should I ask instead? – EJoshuaS Oct 4 at 4:01

You must log in to answer this question.

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