2

There seem to be a lot of people who think that questions regarding optimization of working code belong on Code Review, while others think such optimization questions belong here (on Stack Overflow, not meta, of course).

Now, I agree some optimization-related questions should be directed to Code Review (particularly ones with more code looking for more in-depth/complete review and optimization), but I personally don't think optimization questions should be automatically punted to Code Review (especially if they're smaller amounts of code and are looking for a targeted review/optimization).

It seems to me that Code Review and Stack Overflow have some kind of intersection of interests in relations to optimizing code. Is there a more authoritative source (as opposed to my own opinionated brain) which I (and others) can consult to help clarify the ongoing confusion of what belongs on CR and what belongs on SO (specifically regarding optimization of working code)?

I've seen the brief FAQ of CR and SO both quoted in favor of keeping/punting optimization-related questions. I'm looking for an additional resource/community consensus which I may use to further clarify this for myself (and then share said resource with other punt-trigger-happy users).

  • SO has the VTune tag. That seems to be highly related to optimization. – Matthew Lundberg Feb 16 '14 at 3:46
  • 4
    In my experience, Stack Overflow generally prefers questions about code that doesn't work. – user102937 Feb 16 '14 at 3:58
4

The first question you linked never got closed (it didn't attract the necessary close votes), so it's still on Stack Overflow. It was never flagged for migration to Code Review. I consider it on-topic for Stack Overflow.

The second question you linked has a comment on it about it belonging on Code Review, but a contrary comment that says it's on-topic (having 34 upvotes). It never attracted a close vote or a flag requesting migration. I consider it on-topic for Stack Overflow.

The third question you linked is squarely on topic for Code Review, and is a better fit there. It received three close votes for three different reasons (off-topic, unclear and too broad). The OP deleted the question an hour ago, seven hours after it was asked.

The fourth question is clearly a Code Review question. It was closed as off-topic; all four close votes (and two moderator flags) say the question belongs on Code Review, not Stack Overflow.


In general, Code Review is for working code where you want a full critique of the code. That kind of question would never fly at Stack Overflow because it is too broad, but if you're looking for a specific suggestion about a specific optimization (how to make some piece of code run faster, for example), that kind of question would fit perfectly well at Stack Overflow.

  • My take from this (which is more or less my original thoughts): Code Review is for questions with more code looking for a more in-depth/complete review and optimization, and Stack Overflow is for questions with smaller amounts of code looking for a targeted review/optimization. Correct? – Cornstalks Feb 16 '14 at 4:32
  • More or less, but Code Review will still accept the latter type of question. You should read the Help Center/On Topic article for each site; they are dramatically different. While Code Review is not specifically mentioned in the Help Center/On Topic article for Stack Overflow, Stack Overflow will accept a code review question if it is asking for something specific enough. Stack Overflow perceives your latter example as a troubleshooting problem, rather than a code review exercise. – user102937 Feb 16 '14 at 4:35
  • Cool, thanks. I've read those but didn't quite feel satisfied. I personally justify specific optimization questions as being a special subset of software algorithms, which are on topic for SO. But others' opinions made me question my conclusion. – Cornstalks Feb 16 '14 at 4:39
  • I completely agree with this synposis. But the comment above, "In my experience, Stack Overflow generally prefers questions about code that doesn't work" is right on. On SO, we don't mind (usually) helping with making a function more efficient or some other small piece of code but it isn't the place to look at a whole class and indicate all of the places that could be rewritten. That's simply not what it is there for. However, I know personally I will make recommendations when answering a "it's not working" question when I see things that can be done differntly along with my answer. – codeMagic Feb 16 '14 at 5:32

You must log in to answer this question.

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