Stack Overflow question checklist

Note: this post is now available with a tinyurl of http://tinyurl.com/stack-checklist

My earlier post on how to write a good question is pretty long, and I suspect that even when I refer people to it, often they don’t bother reading it. So here’s a short list of questions to check after you’ve written a question (and to think about before you write the question):

  • Have you done some research before asking the question? 1
  • Have you explained what you’ve already tried to solve your problem?
  • Have you specified which language and platform you’re using, including version number where relevant?
  • If your question includes code, have you written it as a short but complete program? 2
  • If your question includes code, have you checked that it’s correctly formatted? 3
  • If your code doesn’t compile, have you included the exact compiler error?
  • If your question doesn’t include code, are you sure it shouldn’t?
  • If your program throws an exception, have you included the exception, with both the message and the stack trace?
  • If your program produces different results to what you expected, have you stated what you expected, why you expected it, and the actual results?
  • If your question is related to anything locale-specific (languages, time zones) have you stated the relevant information about your system (e.g. your current time zone)?
  • Have you checked that your question looks reasonable in terms of formatting?
  • Have you checked the spelling and grammar to the best of your ability? 4
  • Have you read the whole question to yourself carefully, to make sure it makes sense and contains enough information for someone coming to it without any of the context that you already know?

    If the answer to any of these questions is “no” you should take the time to fix up your question before posting. I realize this may seem like a lot of effort, but it will help you to get a useful answer as quickly as possible. Don’t forget that you’re basically asking other people to help you out of the goodness of their heart – it’s up to you to do all you can to make that as simple as possible.


    1 If you went from “something’s not working” to “asking a question” in less than 10 minutes, you probably haven’t done enough research.

    2 Ideally anyone answering the question should be able to copy your code, paste it into a text editor, compile it, run it, and observe the problem. Console applications are good for this – unless your question is directly about a user interface aspect, prefer to write a short console app. Remove anything not directly related to your question, but keep it complete enough to run.

    3 Try to avoid code which makes users scroll horizontally. You may well need to change how you split lines from how you have it in your IDE. Take the time to make it as clear as possible for those trying to help you.

    4 I realize that English isn’t the first language for many Stack Overflow users. We’re not looking for perfection – just some effort. If you know your English isn’t good, see if a colleague or friend can help you with your question before you post it.

  • 36 thoughts on “Stack Overflow question checklist”

    1. And in many cases if you put this effort into formulating your question, it is very likely that you find the answer yourself, before actually posting the question.

      Like

    2. Yasser – JsFiddle can help, but shouldn’t be the _only_ place to view the code.

      JsFiddle is great to help support those answering, but a question should stand on its own.

      Like

    3. Sometimes the research suggestion is a task in itself – if the issue is an actual problem, then research is easy, but when you have a more involved issue like “how the hell do you genericise this…” then research becomes more of an issue as the topic is huge and varied, and often you need to ask the question just to get points on where to look.

      I posted something on Code Review (a Stack Exchange site) regarding genericising a code block and the immediate comment made was “do some research” – I have no idea *what* to research, that’s the point in asking on such a site n the first place! I don’t mind doing research, so please suggest topics to research – it was obvious from the question I posted that it’s not a simple “use a base type or interface”, and indeed needs types passed around as well as collections and objects, but I have no idea where to begin.

      Rant over :) I think my point is, it’s often easy to find yourself in a situation where you know something is possible or preferable, but have no idea where to start to get there.

      It’s very hard to find a community that is willing to support those type of questions, and often it requires a fairly detailed knowledge of the more advanced portions of the language, not something you can flip to a chapter in a book and go “aha!”…

      Like

    4. @Richard P: Yes, there are some cases where it’s tricky to do research… but you can at least think about it first and list the options you’ve considered, along with the pros and cons of each approach. That’s still effectively research.

      The target audience for this most is mostly people who simply don’t put any thought into their problem before asking a question, and then don’t put any thought into what information will be required in order to help them.

      Like

    5. This is great. Would it be a good thing to have this on Meta? It might develop over time, and it looks like a constructive approach to where “What Stack Overflow is not” failed. What do you think Jon?

      Like

    6. Good list.

      One additional point for those for whom English is not their first language: “kindly” has a very different meaning from “please”.

      “Please” is just asking someone to do you a favour, whereas, in English-speaking cultures, “kindly” is generally used in an aggressive tone, as in “would you kindly stop your dog fouling my lawn”.

      So when you innocently ask for sample code with “kindly provide example?” it sounds to an English-speaker as though you think they should have done that already, and you’re mildly annoyed at having to remind them.

      Like

    7. If you don’t want to post it yourself, I can post it on Meta in your name, and ask for it to be dissociated from my account. Whatever works best for you. I guess there is the remote chance it could go the way of What Stack Overflow is Not (ie. get burninated by the management), but I just can’t see this list becoming a meme used to be rude to people. It would be worth a try either way IMO.

      Side note, the Captcha image in this comment section is broken for me in the latest stable Chrome on Mac OS X – it shows the “broken image” icon. The console is blaming an unspecified error, saying “failed” for the status but not anything else. However, if I isolate the URL and open it in a separate tab, it works. Weird.

      Like

    8. I’d also like the bullet point, have you killed all “Lol” smilies, and general chit chat, signatures, demands for action, etc.

      eg, I want to kill things like “Hi guys, lol, I have a problem with C#, I hate windows lol :-), can you guys give me a quick answer, I need this solved right now, thanks, Bevan”

      Like

    9. @Pekka: Okay, I’m happy to post it myself – tomorrow though; I’m turning off soon :)

      @Keith: I don’t see those problems quite often enough to make the list, to be honest. At 13 points it’s already pretty long – I’d rather *cut* items than add them at this point.

      Like

    10. Although sound advice all along, sometimes you have to consider whether the value of getting a solution/answer justifies the effort.

      Also, you could spend hours doing this for what someone else might consider a simple problem with an obvious solution. Use this advice to iterate on your question, updating it and providing additional details as you go along.

      That said, I endorse the idea of short but complete code samples, and often send people to http://www.yoda.arachsys.com/csharp/complete.html (and its sibling, http://www.yoda.arachsys.com/csharp/incomplete.html). As true today as when they were written, by none other than the man himself.

      Like

    11. @Morten: If it doesn’t justify the effort on the part of the questioner, why would it justify an *answerer* putting in the effort to answer a badly-written question?

      Additionally, the process of writing a good question is often enough to give you the answer without even actually posting the question.

      Personally I think it’s a matter of respect. When I post a question, I respect the fact that others will be taking their time to read my post, with no material reward. I show that respect by putting *my* time into making the question as easy to understand and answer as possible. This scales well – if it takes me one more minute to save a reader 10 seconds, then the world wins even if only 7 people read the question. If a hundred people read it, that’s saved over quarter of an hour.

      Like

    12. I’ll agree as far as saying that as a questioner you should carefully evaluate what information is likely to be needed in order for people to be able to give you the desired answers.

      But that does not imply that every problem is worthy of local triage, documentation, isolated reproduction, etc. If I judge that people will be able to give me qualified answers without going through the complete list above, then I’ll give it a go.

      Maybe I’m like 70% of all males, who think they’re better than average drivers, in that I think I’m a decent judge of what it takes to post a question. Or maybe I’m being selfish, who knows.

      Regardless, it’s a sensible check list all the same.

      Now, why does my Google Chrome not render your captcha image? I have to save it and view it outside the browser to post :)

      Like

    13. @Morten: As I said before, I strongly suspect that if you go through the full list, a lot of the time you’ll find you won’t ask the question in the first place. And those in most need of looking at this post are probably the ones who are *least* qualified to judge what’s required for an answer. So yes, there are corner cases – but I think it’s better to err on the side of encouraging more thought rather than less.

      As for the CAPTCHA – there’s nothing I can do about that while I’m using this blog :(

      Like

    14. A common pet peeve is line numbers. They are either dropped from error messages, or mentioned as “Line 2042” when the code snippet contains 17 lines. Posters should clearly indicate where the problem occurs. And when, i.e. compile-time or run-time.

      Like

    15. A very useful list, thank you.

      Looking through the other end of the telescope: As a frequent asker of questions in a very narrow specialized area, I only have a few help sites available, and all of them are infected with a phenomenon that drives me crazy.

      At least half the time, no matter how carefully I phrase my question, I get a “Why do you want to do that?” answer, or worse, “You shouldn’t be doing that”. Most of the respondents are in positions of authority (e.g. IT Managers) and can control their environment and, to a degree, their users, whereas I’m a casual independent support person who uses what the client has and complies with their business rules (or endures the lack of them).

      So when I ask a question about a technically obsolete tool or how to cope with some “dirty” data, it’s because that’s the tool that my client has or that’s the data that they (or THEIR clients) create. The person posting a reply often sees things from his point of view (I would use X editor instead of Y … I would insist the Finance Manager submit files for upload with no embedded blanks), which is of no use to me at all. I have Y editor at my disposal and the Finance Manager has told me to make it work with blanks.

      The worst element of this scenario is that one person having jumped in with a useless answer, others who happen along later and may have been able to answer my question (as asked!) see that the post has an answer and move on without reading it. It’s my experience that often the most knowledgeable people cherry-pick in this way as they are often the busiest.

      And (apart from here now) I can’t complain, because then I get the “helping you out of the goodness of my heart” response, as alluded to above. I see it differently. If you stop your car to ask someone for directions and he says, “Oh, you shouldn’t go to that restaurant, the service is terrible! Here are directions to MY favorite restaurant”, then I think you are entitled to be annoyed at his lack of respect for your wish to be directed to the location of your choice.

      Thank you for letting me get that off my chest.

      Like

    16. First, as almost everyone is complaining about SO, I want to say THANKS to ALL contributors. If I had to pay for the knowledge I got from you, I would be broke till death! The structre of SO makes it far easier to find the wanted information than usual forums, where the gems are hidden in many post (discussions, OT, …) and you have to read ten times more text for the same infos. Compared to other places in the www the tone is mostly objective The problem I think is SO is for pros, but misused by non-pros that need pro-knowledge..

      My original intention for this post: The first advice “Have you done some research before asking the question? ” should include that it is mandatory to do webseatch with the questions title as search string, what leads to an answer most times (I know nothing, except how to search and find my answers)! This should be done automatic before clicking on the send question button.(maybe a feature?)

      Like

    17. When you have been spending months on a program, not sleeping for days some times, writing a perfect question is hard and not even your objective. Imagine being so tired and frustrated that every line of code you compile has an error. Then imagine how hard a person like this will have it to ask a perfect question. I understand people at stackoverflow are busy with their work and time; but if you don’t have time to answer my question and you find it dumb; just let my question be. Why the hell are you finding time to write dumb comments about my question. Why you can close my question and yet won’t delete my question; since stack over flow storage is so precious. Why not let my question be and when someone that has time to answer my question, answer it?

      Like

      1. I wish I hadn’t used the word ‘perfect’ in the first blog post. Just ‘good’ would have been better. But I disagree with your general argument – in the same way that being stressed about your life doesn’t give you the right to go into a bar and start cursing at the bar staff. If a question is poor – and many questions are really awful – I think it’s entirely reasonable for the SO community to request improvements and clean up if the question isn’t improved.

        Like

    Leave a comment