Skip to main content
1 of 4
Robert Ryan
  • 1.7k
  • 10
  • 17

Encourage Questions to Include Code Samples

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."

Robert Ryan
  • 1.7k
  • 10
  • 17