14
\$\begingroup\$

I've been an active member of StackOverflow for more than two years, and have a decent amount of rep on some other SE sites like Programmers, Code Golf and here. But the one type of question that still haven't figured out where it goes is the following question:

I did XYZ. It worked. Is it a good thing to do? Is there a better way to do it?

However, the post is not a complete, working program. It's a code snippet to say "Here's the thrust of what I'm doing", but it's not complete enough to be able to throw it into an IDE and click go.

Which site does it go on? Because there's no "problem"... my gut is that it should go here, and not on SO (and certainly not on Programmers). But perhaps SO is the right place.

For reference, here's the StackOverflow question that inspired me to make this post (update: the post has been migrated)

The true struggle with questions like this, I've found, is that if the user hasn't made a mistake, the only answer you can give is "Yup, looks great!" Only on Code Review is it the mission for the reviewer to come up with issues the asker hasn't thought about... but on the other hand, if the code is incomplete, there isn't really much else to write about!

Perhaps the reason I can't figure out which site it should go on is that such questions should go nowhere. If nothing's wrong, there's no question to answer. If your code snippet works, wait until something breaks, and THEN post about it somewhere. And if it doesn't break, maybe it's a full Code Review question waiting to be born down the line.

Which site should such questions go on, and why?

\$\endgroup\$
  • \$\begingroup\$ There's nothing I hate more than "DRY my code" questions over on SO. They're so vague/broad that the only person they'll help is the asker because there's rarely any good keywords to search against. \$\endgroup\$ – cimmanon May 4 '15 at 1:57
11
\$\begingroup\$

Your example looks like it is on-topic for Code Review. We don't require the code to be fully executable as posted; sufficient excerpts from working code are fine. That question also appears to be detailed enough so that it's not generic or hypothetical.

The question is, is it off-topic for Stack Overflow? That determination would be best left up to Meta Stack Overflow. It might be faulted for failing to identify a specific programming problem. Unfortunately, while that requirement is mentioned in the Help Center, it is not one of the standard off-topic reasons. That leads to people making well-intentioned but poorly justified comments like "I vote to close this question because it would be a better fit on Code Review". ("Better fit" is not a sufficient justification for migration.)

\$\endgroup\$
  • 1
    \$\begingroup\$ Well, for that example in particular, I left a comment asking him to clarify if he does have a problem. Perhaps he does, and it could be edited to be more on-topic for SO. If not, I'll flag for migration. \$\endgroup\$ – durron597 Apr 27 '15 at 21:17
  • \$\begingroup\$ Actually, if the OP can't identify a specific problem on SO, the close reason would be "unclear what you're asking". Unfortunately, such questions rarely get closed before some well-meaning low rep provides an answer. \$\endgroup\$ – cimmanon May 4 '15 at 1:55
4
\$\begingroup\$

I did XYZ. It worked. Is it a good thing to do? Is there a better way to do it?

It says "It worked", so I think it is welcome on Code Review. It even says "Is there a better way to do it?" which is also Code Review's area of expertise.

Perhaps the reason I can't figure out which site it should go on is that such questions should go nowhere. If nothing's wrong, there's no question to answer. If your code snippet works, wait until something breaks, and THEN post about it somewhere. And if it doesn't break, maybe it's a full Code Review question waiting to be born down the line.

I have more and more sensed that there is a lot of uncertainty and lack of self-confidence, and confidence in your code among programmers (Stack Overflow users and Code Review users)

Many times I have encountered questions similar to your example question but more of the form:

"I did XYZ. Is this right?"

These questions are a lot more problematic, as it indicates that the code might not have been tested enough. There have been meta questions before about whether or not asking for correctness is on-topic here, and honestly I don't think we are very clear on that subject. Code should be tested before coming here, and many users are way too worried about their code. Perhaps the real questions they should be asking are: "How can I make sure that my code is correct?" "How can I learn to test my code properly?"

Related:

\$\endgroup\$

You must log in to answer this question.

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