22

I saw this today.

It's a description of Short, Self Contained, Correct (Compilable), Example. This would be a useful reference for many as a guideline for how to make code usable in questions on Stack Overflow.

It's based on these four points

* Short (Small) - Minimize bandwidth for your example, do not bore the audience.
* Self Contained - Ensure everything is included, ready to go.
* Correct - Copy, paste, (compile,) see is the aim.
* Example - Displays the problem you are trying to solve.

I thought it was pretty cool and could perhaps be worked into the Stack Overflow FAQ or wherever.

Is this a useful guideline, and what other code guidelines might be useful for Stack Overflow examples?

4
  • 6
    Do people even read the FAQ?
    – random
    Sep 20, 2009 at 16:56
  • 5
    @random: no. But we must aim high. Sep 20, 2009 at 17:51
  • 5
    If you aim too high you'll miss the goal. Sep 20, 2009 at 18:14
  • 4
    @Olafur: Or, if your aim's good enough, you'll hit that cute girl in section 3B and you can grab her number after the game. But hey, maybe I'm the only guy whose pickup line is a soccer ball in the face.
    – Eric
    Sep 20, 2009 at 18:38

2 Answers 2

23

Eric Raymond wrote a whole bloody treatise on asking technical questions. The problem that became evident was that people who want to learn how to write a good question and people who can't write a good question are mutually exclusive groups.

I wouldn't mind seeing these four bullet points on the FAQ, though. Just to reinforce that we do, actually, like well-worded and well-thought out questions.

4
  • 5
    I like the point about them being mutually exclusive groups. Well, I don't like it, but I think it's true. Sep 20, 2009 at 17:52
  • 3
    @Yar: It's a sad fact of life. They're mutually exclusive for the exact same reason that people who want to learn and people who aren't learned are mutually exclusive.
    – Eric
    Sep 20, 2009 at 18:39
  • @Eric Your point was recently shown using Death Star-looking graphs.
    – dwitvliet
    Aug 26, 2014 at 22:41
  • 4
    @Eric: "people who want to learn and people who aren't learned are mutually exclusive" That's absurd and offensive to every beginner. Nov 23, 2014 at 1:02
17

Personally I think using a fairly obscure acronym (I'd never heard about it before) doesn't help as much as making it explicit. I tend to say:

Please provide a short but complete example which demonstrates the problem.

I think that's clearer than even the expanded acronym. I have my own page about it which I sometimes reference: http://pobox.com/~skeet/csharp/complete.html - occasionally I've had to refer readers to a second page too: http://pobox.com/~skeet/csharp/incomplete.html

2
  • 10
    You've truncated your saying. It usually goes, "Please provide a short but complete example which demonstrates the problem for these mere mortals. In any case, I fixed it, for I am Jon Skeet. (Audible gasp.)"
    – Eric
    Sep 20, 2009 at 18:42
  • 3
    I concur with this 100%. I swear if I see another link to sscce.org in a comment my head might actually explode.
    – corsiKa
    Mar 20, 2012 at 19:05

You must log in to answer this question.

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