It's not uncommon, especially when dealing with questions by new users - that questions include hundreds of lines of code, 99% of them completely unrelated to the question. Something like "Here is my code, why does X not work here?". ( eg )

Looking at the current close reasons - this one seems the closest:

This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.

However, the wording of the last sentence:

Describe your problem in more detail or include a minimal example in the question itself.

Implies either more detail or a minimal example.

Can the wording of that close reason be changed to reflect somehow the (pretty common) case of a question containing way too much irrelevant code?

Obligatory apology if this is a duplicate and rant about how meta search is bad or I'm bad with it


  • 5
    If there's so much code you don't know what the question is, isn't that "unclear what you're asking" ? I think it's best to focus on what my problem as an answerer is, not on what specifically is wrong with the asker. Not "you're doing it wrong" but "I can't help you and I want to". (That's why I want unclear what you're asking renamed unclear what help you need, but in the meantime I use it as though it was renamed already.) – Kate Gregory Feb 1 '14 at 20:13
  • 2
    @KateGregory Sometimes, it is clear what is being asked (e.g. "Why is drag and drop not working given the following code") but the question contains a lot of irrelevant code and it makes finding the problem very hard and the usefulness for future visitors zero. I was thinking about 'very low quality' but I'm unsure about that. The old close reasons covered this more nicely. – Benjamin Gruenbaum Feb 1 '14 at 20:15
  • 3
    @BenjaminGruenbaum a long time ago, we just downvoted poor questions. If there isn't a close reason that fits and you don't want to answer it, just downvote it. Not everything that is bad needs to be closed. – psubsee2003 Feb 1 '14 at 20:26
  • 2
    I'm inclined to think that if a user posts a question with < n lines of code-formatted text, they should be prompted with confirmation; "Is all of this code necessary to reproduce the issue? Consider an SSCCE." – Dan Lugg Feb 1 '14 at 20:27
  • @BenjaminGruenbaum hence my wish for a rename. They want to know why it isn't working and one can argue that is clear. You don't know what they don't know, why they've included so much code, what they understand and what is a mystery, -- that's what's unclear: how can you help them? – Kate Gregory Feb 1 '14 at 20:28
  • @BenjaminGruenbaum I mean you said it yourself: makes finding the problem very hard – Kate Gregory Feb 1 '14 at 20:28
  • @psubsee2003 downvotes on questions by new users do not really help them very much. It's important they understand how the system works and not just feel threatened. meta.stackexchange.com/questions/9953/… I agree that bad questions should be downvoted but I like the idea of helping new users. – Benjamin Gruenbaum Feb 1 '14 at 20:30
  • @KateGregory I don't see why the two contradict. The problem is very clear but finding what's causing it is very hard. – Benjamin Gruenbaum Feb 1 '14 at 20:34
  • 2
    @BenjaminGruenbaum I get that, and I hate random downvoting of new users. I generally try to leave a comment explaining why, but my point was that part of the reason the close vote queue is so large is people seem to believe anything "bad" needs to be closed, and that isn't always the case. I'm not saying examples like yours don't need closed (I think the reason you quoted would work find), but I'm getting frustrated with the "find the close reason" questions on meta. If there isn't an applicable close reason then it shouldn't be closed. – psubsee2003 Feb 1 '14 at 20:35
  • 1
    @psubsee2003 closing is a big giant "fix your question" hammer. If it worked, and forced all bad questions to turn into good ones, that would be kind of cool. But with a 100k review queue, it probably means less to some users than a downvote would. It should be reserved for questions that cannot be answered - because you can't figure out what they need, or because it is offtopic. – Kate Gregory Feb 1 '14 at 20:39

This is one of those problems that's hard to capture effectively in a specific close reason: if you don't already know what the problem to be solved is, it can be really hard to identify cases where too much code (or simply irrelevant code) is provided. And if you already know what the problem is, then you're kinda past the point where you need to close the question...

So the cases we should be focusing on are those where:

  1. There's a huge amount of code and
  2. It's not clear to someone with knowledge of the relevant subject what the problem is

And there's a very specific close reason for #2:

unclear what you're asking

As a part of the recent changes made to close reasons, this particular close reason now links to a page that explains how to write a clear, specific question. I highly recommend using it in cases where...

  • ...No specific problem is identified
  • ...A specific scenario or set of requirements are described, but the asker fails to identify what he wants as a result of this.
  • ...The wording or formatting is so poor as to make reading the question exceptionally difficult.
| improve this answer | |

While I believe that we are reasonably armed to deal with code-wall questions, through either close-voting and/or down-voting, perhaps some users need a tap on the shoulder.

As mentioned in my comment, I believe a confirmation dialog would give users an opportunity to reconsider the code included in their question with respect to the question itself.

  • User copy-pastes entire application into question box
  • User proceeds to hit Post Your Question
  • User is met with a big ole' dialog box:

    Whoah! We noticed a lot of code in that question.
    Is all of the code you have provided required to reproduce the problem? Make sure you're providing an Minimal, Complete, Tested and Readable example, and not a lot of unrelated fodder.
    Wait, I Need To Edit All The Code Is Necessary

This could be triggered on questions with more than a defined number of bytes of code-formatted text. The defined number, however, is open to debate.

| improve this answer | |
  • Note that there's already a check in place that will completely block the question if the ratio of non-code to code is less than a certain threshold. Here's an example of the sorts of idiocy it can generate... I suspect a lot of folks would just blindly click "all the code is necessary" in your UI. – Shog9 Feb 1 '14 at 21:27
  • @Shog9 I didn't realize such a check was already in place. I still feel this feature would be beneficial, perhaps alongside the outright blocking, however, you're right; some users will inevitably just click past. We do have close/down-votes reserved for them ;-) – Dan Lugg Feb 1 '14 at 22:05
  • New users (and not only) often use code blocks for quotes and error tracebacks, which could be large, but message will be confusing in such cases. Otherwise, the "minimal example" phrase would be a nice fit and probably that closing reason can be tweaked... – sashkello Feb 1 '14 at 22:44
  • @sashkello Stack traces would be an exception (heh) to the rule, so rather than a hard limit check of n-bytes it could be based on a ratio, much the same as the current preventative measures are. A stack trace should still need to be accompanied by an explanation anyway; more than "HAI, Y U NO WERK!?". Users that are misusing the formatting are doing it wrong. In any case, the message phrasing is open to re-wording, I reckon it would need to be anyway. – Dan Lugg Feb 2 '14 at 14:32

You must log in to answer this question.

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