Stack Overflow question 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.

  • 17 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.

    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.

    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!”…

    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.

    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?

    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.

    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.

    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”

    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.

    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.

    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.

    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 :)

    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 :(

    Comments are closed.