Q:

When should I answer/close "Why doesn't my code work?" questions?

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?

A:

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.

