10

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

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. – Robert Ryan Aug 24 '12 at 16:35

You must log in to answer this question.

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