What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

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.

share|improve this question
1  
2  
Leave a comment, downvote and/or vote to close (in no particular order). –  Robert Harvey Jul 17 '12 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. –  Robert Ryan Jul 17 '12 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 –  skinnyTOD Jul 24 '12 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. –  Robin Green Jan 5 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,
share|improve this answer
    
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 .