2

I am a little confused about how to deal with "Why doesn't my code work?" questions. On one hand, they appear to be acceptable under the MVCe rules. On the other hand, I fail to see how they could possibly be useful to anyone, even the OP, after the OP learns the answer. They can't ever be closed as a duplicate, because each person's code is a 'snowflake'. And half the time, the bug(s) are really trivial (slight logic error or tool misuse).

So if these are actually bad questions, what should I be doing about them?

If they aren't bad questions, how do they contribute to the value of SO?

2
  • Don't overcomplicate this. If they're bad questions, then you should be closing them. We have a bunch of close reasons; you should be able to find one that applies. If you can't, then the questions are valid and should not be closed. Downvote them if you think they are not useful.
    – Cody Gray Mod
    Commented Jul 27, 2017 at 13:39
  • @CodyGray, So you're saying treat debugging help questions the same as code explanation questions? Part of why I'm confused is I was told that "valid but useless" questions where bad. (it was written somewhere in the help section. can't find it)
    – Tezra
    Commented Jul 27, 2017 at 13:45

1 Answer 1

4

If the question is just a code dump and a "why doesn't this work", then there's a close reason specifically for that:

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

If the question contains a code snippet, an explanation of what it should do, an explanation of why it's not doing what it should be doing, and the code snippet is capable of reproducing that erroneous behavior, then it's a good question. It could be closed as a duplicate of any other question with the same problem, and others could be closed as a duplicate of it. Such a question could also have other problems (the description of the problem or desired behavior may not be clear, the scope of the problem could be Too Broad, it could be just off topic, etc.) and if the post has any other problems, feel free to address them as appropriate.

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