I know this has been noted before, but it's amazing how often people ask questions about code that's not working without sharing the code. And when they share code, it's often insufficient (which makes sense, because often if you can't solve a problem, it's often because you're looking in the wrong place). I'd like to suggest that we work harder to steer people away from abstract theoretical programming questions to more pragmatic, concrete situations. Anyway, I'd like to propose:

  1. Can we update FAQ to more strongly encourage the use of including code samples? Right now it simply says "We feel the best Stack Overflow questions have a bit of source code in them". Maybe strengthen that by preceding that sentence with something like: "If you are having problems with your code, always provide source code samples." Or maybe even better "If you are having problems with your code, always provide comprehensive source code samples."

  2. Can we update How to Ask to reflect this, too? Right now that page says nothing about source code samples.

  3. In the spirit of the "who reads the FAQ", perhaps we should tweak the the actual Ask Question page, too. There is a box titled "How to Ask" - "Is your question about programming?" that says "Provide details. Share your research." Maybe tweak this to also say "Include source code."

I just don't get the mindset of "let's not help them up front, but just tell them when they get it wrong." Waste of the OP's time. Waste of ours. Seems like there's a strong mindset to defend the status quo, rather than seriously considering ways to improve it.

  • 1
    I point people to these blog posts: dba.blogoverflow.com/2012/06/help-us-help-you msmvps.com/blogs/jon_skeet/archive/2010/08/29/…
    – Aaron Bertrand Staff
    Jul 17, 2012 at 13:48
  • 2
    Leave a comment, downvote and/or vote to close (in no particular order).
    – user102937
    Jul 17, 2012 at 15:18
  • 1
    Agreed. That's what I do (leave comment usually). But seems like we should give noobs a chance to get it right first time around. Jul 17, 2012 at 15:52
  • 1
    One simple, passive way to encourage this would be to add prompt text in the question body text box as I demo here: meta.stackexchange.com/a/140517/182042
    – spring
    Jul 24, 2012 at 20:49
  • Another manifestation of this problem is some of the XY problems. They may be asking about how to do something in a certain way, but the reason they're asking might just be: I tried to do it this (valid) way, but it didn't work so I assumed it couldn't be done that way. Jan 5, 2014 at 13:25

1 Answer 1


My first reaction was "Vote up posts with code and vote down those without", as in including a comment of "+1/[-1] for [not] including source", but for those questions where its the askers first question or the asker never returns or doesn't respond, there isn't much 'encouragement' - and maybe for those there never will be.

I see this in two parts,

  1. is up/down voting enough encouragement/discouragement to include code
  2. If the answer to #1 is 'no', do we need a structural change like @skinnyTOD linked,
  • I agree that the problem is the first time poster. Most of the time I'm putting up a "please provide source code" comment, the OP has single digit reputation. (People quickly realize that coding questions can't be answered without code!) While I like skinnyTOD's suggestion, I'm not sure if I understand why there would be any reluctance to update the instructions (especially my point 3). If SO doesn't tell people to provide code, they won't! The problem is not that we can't elicit code with a well worded comment, but rather the question is why do I have to write just a comment at all. Aug 24, 2012 at 16:35

You must log in to answer this question.

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