8

I find that a lot of questions on Stack Overflow are lacking some motivation and context (and could be XY problems). Very often I am commenting new questions by requesting more context & motivation.

For example, this question about "locate the machine instructions that access memory" could be asked both by a graduate student starting a PhD thesis on compilation or static analysis, or by a software developer struggling with a hard to find bug in a million line code base (and I would have adapted my answer differently for each cases, and probably given some very different answers, or at least focus on different items).

But most questions don't give enough context and motivation, and are generally too short. Another example is this question (or that one). With motivation and context information (even a single sentence!), I would have spent much less time answering it.

I feel that:

  1. The text area (in the web interface) for typing the question is often too small. Perhaps making it larger (by default) could help a bit, and make people ask longer questions.

  2. Beginners on Stack Overflow should be reminded that they should generally give not only some MCVE, but also explain their work context in a few sentences. Maybe newbies could be presented a TODO list like:

    • Have you provided an MCVE?

    • Have you read documentation? Tell which one in your question! Have you enabled warnings from your compiler and used the debugger?

    • Have you explained -in one or a few sentences- your general context and work and overall goal (e.g. what kind of application are you coding, with what language, tools, systems)?

Perhaps also the web system could detect those questions which are shorter than e.g. the average of well graded questions (e.g. compare against the average size of questions having a score above 5) and notify the user?

Of course, question motivation should be given after the question itself. All the questions I have asked and which have been well scored have motivation (which I sometimes added after asking the question, but before it was upvoted).

Perhaps even the web interface for questions might have two text areas: one for the question itself, another for the motivation and context (and present the later in a slightly smaller font).

20
  • 6
    related meta.stackoverflow.com/questions/357951/… Oct 22, 2017 at 9:48
  • 29
    At least for me: The shorter a question is and the less it talks about things only closely related to the problem, the more likely I will read and answer it. Nothing worse than a question about a specific problem where the first two paragraphs explain why the code has been written and you have to find the actual question first.
    – BDL
    Oct 22, 2017 at 9:52
  • 5
    @BDL: I disagree. The paragraphs explaining why the code has been written should be put at end of each question. Oct 22, 2017 at 9:54
  • 14
    Unless it is needed to answer the question (and I doubt that there is a high number of questions where it is needed) it shouldn't be in the question at all. I'm not even sure if the example you linked really needed this. But thats my opinion, let's see how the rest of the community think about it.
    – BDL
    Oct 22, 2017 at 9:57
  • 4
    I have the impression that I quite often give the same (or similar) comments to new questions: 1. enable compiler warnings and use the debugger. 2. give much more context about your question. I'm sure that these two cases fill the majority of my comments on questions on SO! Oct 22, 2017 at 10:01
  • 2
    @BasileStarynkevitch indeed. One of my pet peeves about education; the profs in 'Programming 101' issue homework first and teach debugging after. Inevitable result - bad questions dumped on SO:( Oct 22, 2017 at 10:08
  • 4
    @BasileStarynkevitch (1) We already have a badge for filling in the "About me" section, and a lot of people still have an air of mystery about them. (2) A lot of people do add the context in their questions. But it is often fluff like: "I've been stuck on this for 3 days, and my boss is angry now!" It might be difficult to convey the meaning of helpful context to them. (3) A lot of people don't use correct grammar. So even if they provide relevant context, it might be difficult to follow. (4) A lot of people would be in such a hurry they'd just ignore the optional intro/Todo list. Oct 22, 2017 at 12:55
  • But About Me is not the same as About This Question ... Oct 22, 2017 at 12:57
  • 7
    @BasileStarynkevitch The point is, people aren't going to fill in what they don't have to fill in. Haven't you ever seen poorly indented code in questions? Or entirely in un-formatted code in questions? There is a banner on the question screen that explains how to format the question, and still a lot of people miss/ignore it. Oct 22, 2017 at 13:00
  • @MartinJames Learning how to debug code is nearly impossible when you don't have at least a minimal grasp on writing code first, in my opinion and experience. A bit of a chicken and egg type of situation. The problem is more that profs don't educate students about sites such as Stack Overflow and why they should refrain from asking homework questions there. The internet exists and students have free access to it at almost any time of the day including during the classes; this fact should not be ignored in the tutoring.
    – Gimby
    Oct 23, 2017 at 12:02
  • 1
    I always try to edit out such descriptive fluff. The backstory of how the question came to exist on our site is not relevant 99.9% of the time... what matters is what OP is trying to do, what OP has tried so far, and how OP's attempt is not working. Anything else should be removed.
    – TylerH
    Oct 23, 2017 at 18:24
  • 1
    @NisargShah ... and then they will ask Why was my question deleted??? :-)
    – Skipper
    Oct 25, 2017 at 6:36
  • Answer the question asked. This insistence on including a justification for asking the question is maddening. Ultimately it doesn't matter why the original asker asked the question they asked because the answer is meant to benefit the larger developer community, not just the asker. If someone asked "How do I do X?" and future readers happen upon the question only to find an answer "You actually don't want to do X because Y would be better for your specific situation" the readers still won't have an answer to X, and will have wasted precious research time.
    – user4639281
    Nov 5, 2017 at 18:14
  • 1
    @Basile I don't really agree with your badgering of the user in the comments there. If the question is "How do I do X?" but X is impossible, then "It is impossible to do X because ...". If the user asked the wrong question, then they asked the wrong question. We're here to answer questions, not to browbeat users into asking the question we think they should have asked.
    – user4639281
    Nov 5, 2017 at 18:56
  • 1
    In fact, reading your comment thread at the linked question more in-depth, I find your comments there concerning. You insist on an MCVE, which would turn the question into a debugging question. You repeatedly insist on artificially limiting the question. You repeatedly insult the quality of the question. It's very disheartening to see such behavior.
    – user4639281
    Nov 5, 2017 at 19:10

1 Answer 1

10

The problem is that almost any non-trivial how to solve X? problem is open-ended, without a clear technical focus, and thus off-topic for the site (with responses which are primarily opinion-based etc.). So the submitter has to pick some Y and ask for the solution to a specific technical problem. I agree that the original how to solve X? question is usually more interesting, but dealing with such questions would need a major cultural shift.

There is also a religious focus on reproducers. Once you reach a certain level as a developer, you can resolve almost any issue which you can reproduce with something that fits in a browser text box. For the more complex cases where such a reduction is elusive, detailed environment information (such as exact package/source versions to make sense of line numbers in backtraces) is typically more helpful than the complete source code.

On the more mundane side, a lot of the questions, I see, seem to be homework assignments or specific tasks given to junior developers. In these cases, the submitter might not know the larger context. There might even be none at all because the problem is artificial and exists in a vacuum.

You must log in to answer this question.

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