41

A few days ago, this SO question was put on hold for being out of scope. The comment given that justified the decision was:

This question appears to be off-topic because it is about improving working code. Try posting it at Code Review.

This comment has had 7 supporting votes so far.

My question is: Does the fact that a question is in scope for Code Review thereby make it out of scope for Stack Overflow? Either way, we have a problem. If it does, and Stack Overflow's scope is supposed to be disjoint from that of other Stack Exchange sites, then this really needs clarifying. The "on hold" banner underneath the question just says:

This question does not appear to be about programming within the scope defined in the help center.

But I can't find anything in the help center that says that scopes are supposed to be disjoint. The poor OP (a fairly new user) has been left with some bland text telling him it's out of scope, and directing him to a help page that doesn't back up the decision at all.

On the other hand, if the fact that it's in scope for Code Review doesn't make it out of scope for Stack Overflow, why did the question get shut down so easily? It was a good question! How come five people decided it was out of scope when it wasn't?

My own view is that we should not try to enforce disjoint scopes. There are lots of questions that fall in the grey area between two sites, and could legitimately be posted to either. If a question is clearly out of scope, and would be in scope for another site, it's helpful to suggest posting it there; but I don't think we should close a question simply because it could have been asked elsewhere.

But if there's a strong feeling that we should enforce disjoint scopes, this needs to be said loud and clear in the help pages, and it should be a selectable option when voting to close, so that the OP gets clear feedback.

8
  • 20
    Nope, some topic overlap is fine. However, Code Review is the better place for code critiquing, Stack Overflow is not. We deal more with problems here, less with code that already works.
    – Martijn Pieters Mod
    Sep 2, 2014 at 11:46
  • 5
    @MartijnPieters That's what I thought. So in this case I'd expect a comment to the effect that the question might go down better at Code Review, but not a bullet to the head. Sep 2, 2014 at 11:52
  • 5
    The broadness and vagueness of the question you linked to is off-topic here, but it is better to direct them to a site where it is on-topic.
    – Martijn Pieters Mod
    Sep 2, 2014 at 11:55
  • Yes, I wouldn't have objected if it had been closed for being unclear. In that case, the OP would have been told it was unclear, and would have been encouraged to clarify it. Sep 2, 2014 at 11:58
  • 1
    I think you've done best encouragement by linking to your very well researched and structured question about one particular side of original question with clearly outlined restrictions. Unfortunately there are several equally non-fitting reasons (too broad, opinion based, unclear) to close "my code need to be better" questions that do not specify any concrete problem that needs improvement (more readable, faster, less memory/CPU, scalable whatever). Sep 3, 2014 at 5:35
  • This question was removed from Stack Overflow for reasons of moderation. - Was that really necessary? =(
    – Izkata
    Sep 3, 2014 at 14:57
  • @Izkata It was deleted by 3 regular users. I've voted to undelete it, but it needs more votes to get undeleted.
    – Rachel
    Sep 3, 2014 at 18:29

3 Answers 3

31

Ideally each Stack Exchange site is designed to have a unique scope and focus, though there will inevitably be some overlap between some sites at the edges of said scope. There is also overlap where a new site is proposed to cover a specific topic that is partially covered by an existing site.

However, for Stack Overflow and Code Review the sites are meant to be largely distinct. At one level you could say that Stack Overflow is for broken code ("why doesn't this work", "why does this give the wrong result?" etc.) as well as for certain "how do I do this?" type questions. However, Code Review explicitly states that you must have working code, as their primary goal is to make code "better" (eg. faster, use less memory, etc.)

There could be a case made for posting code that needs "speeding up" on Stack Overflow as it fails to meet a performance target - which can be interpreted as broken code ("The answer arrives too late to be useful" - thank's to @BenVoigt for pointing that one out).

However, basically, if you have working code but want to make it better post on Code Review.

However, if you have broken code post on Stack Overflow.

6
  • 17
    There is some overlap, however. Performance questions can be seen from the perspective of "This works but I'd like to improve the performance.", a good fit for Code Review. Or from the perspective of "This code doesn't work, it's missing the performance target; although the answers are correct they arrive too late to be used." which fits SO.
    – Ben Voigt
    Sep 2, 2014 at 15:37
  • 10
    While performance questions are indeed OK as @BenVoigt pointed out they better be about one concrete measurable issue with code. Unfortunately linked question (and many other once) are "my code is not better enough" - no goal, no particular target to improve, no measurement of any kind just request to make code "the best possible". :( Sep 3, 2014 at 5:24
  • 3
    There are sites designed to overlap - e.g. a bash question could be on topic on SO, SU, AskDifferent, Unix , Ubuntu
    – mmmmmm
    Sep 3, 2014 at 14:46
  • @BenVoigt "'This works but I'd like to improve the performance.', a good fit for Code Review" I disagree: Consider the answer to improving performance ranges from restructuring architecture, leveraging a different algorithm, to data structure choice(B-tree instead). A code review doesn't involve profiling performance and making these kinds of decisions. You might touch on the tip of the iceberg and suggest alternatives, but delving that deep into the solution IMO are very oriented to the task of implementation/design and covers topics such as choosing better algorithms and data structures.
    – AaronLS
    Sep 4, 2014 at 17:00
  • 2
    I think the "you have working code" criteria is far too broad and turns Code Review into a giant bucket where anything can forcefully get thrown. Then questions get moved and the focus of the question moves to reviewing the code instead of focusing on the question being asked. There's little to gain in such a move. If a question is still valid for SO leave it. Just because it meets the criteria of another site doesn't exclude it from SO and doesn't justify a move. The first decision point shouldn't be "Does it fit another site?", but instead "Does it fit SO?(regardless of other sites)"
    – AaronLS
    Sep 4, 2014 at 17:07
  • @AaronLS: Code review often does evaluate data structure choice, though, whether that's using a hashtable for lookup instead of linear search through an unsorted array, or using a StringBuilder instead of creation of hundreds of transient immutable string instances, a good review will point out performance problems caused by using the wrong data structure. Switching out the entire algorithm might indeed be beyond the scope of a review; I agree with you there.
    – Ben Voigt
    Sep 7, 2014 at 12:25
10

I think you're misreading the comment. The off-topic reason is given in the comment itself: it is off-topic because it is about improving existing code. Stack Overflow is for fixing problems with code.

The second sentence simply suggests Code Review as an alternative place to get help, given that the question is off-topic on Stack Overflow. It is not suggesting that the reason for it being off-topic at Stack Overflow is that it is on-topic at Code Review.

Broadly speaking, each Stack Exchange site defines its own scope without reference to any other site. You can see this in the guidelines for creating new sites:

  • When voting, focus on your site
    Don't worry about whether a question might be asked on another site. Your goal is to make the best possible site for this community.

However, once a question has been determined as being off-topic on one site, that doesn't preclude a user from offering another site where it would be on topic. What would be wrong would be saying, "This question is off-topic because it is a better fit for [other Stack Exchange site]."

2
  • 2
    But where in the help center does it say that questions about improving existing code are off-topic? Sep 3, 2014 at 17:19
  • @chiastic-security It depends whether the "improvement" can be worded in terms of a well-scoped question about a specific programming problem. However, this meta question is asking whether being on topic at another site is a valid close reason, which is what I've answered. By all means feel free to ask a new meta question (if it hasn't already been asked) about whether improving working code is on or off topic. Sep 3, 2014 at 17:39
2

I think that post is on-topic, however could use some minor edits.

The "non-working" part of the code is that it is too slow from a performance standpoint. In my opinion, this is on-topic.

I've seen many questions that ask some variation of "What is the [best-performing|lowest-memory-cost|etc] way of accomplishing task X" on Stack Overflow, and have even asked a few myself. Providing the specific criteria for the desired behavior is spelled out, I've never had a problem and always found these answers extremely useful.

In addition, I've found I am far more likely to get a great answer from Stack Overflow on questions such as this instead of from Code Review, since the user base is much larger and more active here.

I've made an edit to the question to focus more on the exact problem the OP is trying to solve - slow performing code - and have voted to undelete the post. I'll also vote to reopen it if it gets undeleted.

3
  • SO's size shouldn't be used as a justification for asking a question on SO rather than some more appropriate site. That can only lead to more noise in the form of marginally acceptable questions on SO and fewer questions on sites where more people are actually interested in that specific kind of question. The Q in question is clearly the "how do I make this working code better" kind of request that Code Review is meant for. Furthermore, how much audience do you really need? If your Q doesn't appeal to 5 or 6 out of 22,000 visitors/day, the problem isn't the size of the audience.
    – Caleb
    Sep 3, 2014 at 17:06
  • 1
    @Caleb Yeah, that was just an added reason for posting on SO over Code Review. The main point of my answer is that I think that question is on-topic here at Stack Overflow. Sure it'd be on-topic for Code-Review too, however it isn't off-topic here and should not have been closed as such, or deleted by other users.
    – Rachel
    Sep 3, 2014 at 18:32
  • 1
    Just as I loathe "Write this regex for me" questions, I don't like "Improve this code for me" questions and I dearly miss the "Too localized" close reason. In order to write or optimize such a specific piece of code, you need to know everything about what OP wants to do. The more information is required to write a proper answer, the less likely it is to help future visitors as it is pointed specifically at solving OP's problem instead of teaching them something or explaining a broader concept. The linked question literally states "I was told this code will perform poorly, why?".
    – CodeCaster
    Sep 4, 2014 at 7:50

You must log in to answer this question.

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