17

As of late, it seems that SO is flooded with "my code doesn't work! [giant code dump] what is wrong? Please help!" type of questions (which are not the same as "do my work" type of questions, IMO).

In my view, these questions do not add anything beneficial to SO. If anything, they are detrimental as they just add noise.

We used to be able to close such questions as "too localized", but this option no longer exists in the "close" dialog.

So, is it ok to close these types of questions and if so, what should we file the close vote as?

1

1 Answer 1

31

A question that says code doesn't work without describing the problem is off-topic for the following reason:

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.

As such, it'd seem reasonable to close such questions.

One might be willing to go the extra mile to debug and figure where the problem lies. Even then, it might not be always possible to take the question to a logical end. If a question doesn't state the problem, a code dump would rarely help any future visitors to the site.

Code dump, per se, doesn't help one diagnose the problem. One needs to describe the problem, too.

26
  • 1
    It might also be (or quickly reveal itself to be) too broad, in that the only way to resolve it is with a debug-via-comment session.
    – jscs
    Apr 27, 2014 at 19:49
  • Sadly, it seems not enough people got the memo. These types of questions are literally flooding SO and it looks like they don't get closed.
    – joce
    Apr 27, 2014 at 19:49
  • 1
    @JoshCaswell has SO turned into a place where people go to have other debug their code, now?
    – joce
    Apr 27, 2014 at 19:50
  • On the other hand, if it can be resolved in a straightforward enough manner, editing after the soltion is discovered, to remove noise and include some higher-level description of the problem, can leave behind a decent QA nugget.
    – jscs
    Apr 27, 2014 at 19:50
  • @JoshCaswell One might vote to close it as too broad. Perhaps that might be ok too. I'd prefer to say that the question lacks information...
    – devnull
    Apr 27, 2014 at 19:50
  • 2
    Unfortunately in a de facto sense it has a bit, @Joce, but personally I encourage you to push back against that use unless the question will clearly result in something useful to someone else.
    – jscs
    Apr 27, 2014 at 19:51
  • 1
    But the OP can argue that (s)he gave enough info as (s)he provided the entirety of the code and the output of the program. It still isn't what SO is (or was?) about.
    – joce
    Apr 27, 2014 at 19:52
  • 3
    @Joce Oh, please! Entire code dump, a link to the code on github or pastebin doesn't matter. If the post expects the readers to figure the problem and fix it, it is off-topic.
    – devnull
    Apr 27, 2014 at 19:54
  • 3
    "a code dump would rarely help any future visitors to the site." being the key thing here. "Fix my code for me" / "Debug my code for me" isn't supposed to be a valid "question" on SO. There's literally not enough of us to even begin to have the resources to figure out what the bugs are and the edit every one of the thousands of these being posted daily. Apr 27, 2014 at 19:55
  • 1
    That's what I'm saying, @Joce: too much of the wrong kind of information makes your question just as unanswerable and unsuitable. "Unclear" might be a better vote choice than "too broad", but it's no good either way.
    – jscs
    Apr 27, 2014 at 19:59
  • 1
    Can you give examples of what is ok? Presumably it is ok to dump code, then say "I've spent hours trying to work through this and I just don't see the problem. Stepping through shows the right value at point X, but the wrong value at Y, but I can't see anything that would change it between those two points. Is there something in this framework that would cause this odd behaviour?" Apr 28, 2014 at 3:11
  • @SteveBennett Yes, the example that you present would be ok. The problem in the code has been described. It should not be like not working, something wrong, does not give the correct answer, ...
    – devnull
    Apr 28, 2014 at 3:13
  • @SteveBennett I actually ask this kind of question a lot. Most of the time I end up answering it myself. Sometimes there is an element of debug-by-comment and those comments can be gold. Often the comment is wrong but it sparks a line of inquiry that reveals the true nature of the problem. You can say this is not what SO is for, but I say the value of SO is that it helps me work out how to do stuff, and if it doesn't help then it's worthless.
    – Peter Wone
    Apr 28, 2014 at 3:22
  • 1
    @PeterWone I'm not paying for storage, but I spend a non trivial amount of time trying to keep this place tidy and it's really getting out of hand. Problem is, SO was not meant for this type of interaction. IMO, SO is supposed to be the place where you go for canonical answers to problems that are or wide-ish interest (one might argue that F#, for example, doesn't have a wide audience but there are perfectly acceptable F# question on SO), and "why is this value X and not Y after a call to foo" is not.
    – joce
    Apr 28, 2014 at 3:37
  • 1
    @Joce - I get the impression that I've offended you. I hope not. That said, I genuinely believe that you are busting a nut to solve a problem that doesn't exist. Give good answers, if you have them, and don't sweat the little stuff. If you think a question is stupid or lazy, ignore it. If you think it's a good question, then vote it up, answer it, give a duplicate xref answer. If the question is excellent but the language is too horrible to contemplate, rewrite. It will all come out in the wash.
    – Peter Wone
    Apr 28, 2014 at 7:21

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