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

I'd like to give my answer to What to do with debug questions now? its own feature request.

There are plenty of questions that just gives a massive amount of code and should be closed for this reason (while not all questions giving a massive amount of code are necessarily bad, most are) (which I hope you agree with).

There isn't really an applicable close reason for these as far as I can see - some argue the "minimal understanding" reason applies here, but I don't see it as "asking for code" (and regardless of whether or not you agree or manage to convince me otherwise, there shouldn't have to be any convincing taking place, it should be completely clear). I guess I could use a custom reason, but I'd prefer a standard one.

So, since the "describe the specific problem" reason already includes a link to SSCCE.org, I suggest we incorporate the "short" part into our close reason.

As an initial draft, change it from:

Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.

to:

Questions concerning problems with code you've written must describe the specific problem — and include a short, valid, complete program that reproduces it — in the question itself. See SSCCE.org for guidance.

(bold is just to indicate the change, not what should be made bold in the final product).

If the "a complete program" would be considered abusable, what about: (thanks to djechlin for pointing out "concise" - it's way better than "short" when talking about code)

Questions concerning problems with code you've written must describe the specific problem — and include concise, valid code that reproduces it — in the question itself. See SSCCE.org for guidance.

Some may say that a short program is not always possible. If this is generally agreed, perhaps:

Questions concerning problems with code you've written must describe the specific problem — and include the shortest possible, valid, complete program that reproduces it — in the question itself. See SSCCE.org for guidance.

Which could, in theory, again be dangerous ("voting to close because of all those line breaks spacing out your code"). If it is, perhaps:

Questions concerning problems with code you've written must describe the specific problem — and include a valid, complete program, that's not excessively long, that reproduces it — in the question itself. See SSCCE.org for guidance.

Anyway, those are just a few ideas. Feel free to suggest / change it to something better.

share|improve this question
3  
didn't we discuss all of this already when the new close reasons were rolled out? –  MattDMo Dec 13 '13 at 3:23
    
@MattDMo No idea, did we (/ you / they)? I don't remember being involved. –  Dukeling Dec 13 '13 at 3:30
1  
An alternative view to the SSCCE wording: meta.stackoverflow.com/q/188511/212780 –  Geobits Dec 13 '13 at 3:42
    
Complete program? No, I will not post my company's build system in my question. –  djechlin Dec 13 '13 at 4:48
    
I define "excessively long" as a method with more than 39 lines. Not all questions can be encapsulated in that space. –  Makoto Dec 13 '13 at 5:22
    
@Makoto Perhaps "that's not much longer than necessary"? –  Dukeling Dec 13 '13 at 6:20
    
While I like SSCCEs, many questions can be answered by examining relevant code, even if it's not compilable. If we closed every question that wasn't an SSCCE, we'd have very few questions left. I think the original wording is sufficient. –  Duncan Dec 13 '13 at 8:23
3  
@Duncan The main idea here is "short" (I notice now that all my suggestions contain "complete program" as well, oops). While I could play spot-the-error in a few hundred lines of code, I don't want to, and I don't think such questions belong here. Which is a better question - "Why doesn't my 200-line program work?" or "Why doesn't == work on Strings in Java? Here's a 20-line program showing what I mean." (which is a duplicate, but not my point)? –  Dukeling Dec 13 '13 at 9:00
    
"Complete program" needs to be replaced with something like "self-contained example", but other than that, +1. This addresses both of the problems I was trying to solve with this suggestion - that it's unclear whether this close reason may be used for wall-of-code or non-self-contained questions, and thus also probably unclear to owners of such questions why they have been closed - without the downsides that led to my more aggressive approach being heavily downvoted. –  Mark Amery Dec 13 '13 at 10:05
add comment

3 Answers

I would vote for "concise, valid code."

  • Not "complete." No, I will not post my company's build system or the numerous middlewares needed to run it standalone.
  • Following your original "discussion" thread, yes, it seems you can't quite close a long "debug this" from the close reason that obviously should apply to it (namely, this one). It's okay for a close reason to have unquantified terms like "short" or "concise" that's up to the community. So do court rulings and our legal system goes on. But it's less okay when the closer has to say "this one is close enough."
  • Definitely not "shortest possible." Too easy to overuse. This isn't code golf. And it rules out pretty much every debugging question - even ones where the OP demonstrates that s/he put considerable ("research") effort into reducing the code to where the error is in. It's better to leave closing up to the good judgment of the community rather than the overly aggressive, perfunctory bad judgment, which I think this wording would do.
  • "Short" implies absolute length. "Concise" implies with respect to itself or as much as possible. In my imaginary English dictionary in my head. That's why I went with it.
  • I can't imagine valid questions that adding the word "concise" makes invalid. In particular there still could be some long-ish code samples, e.g. in an MVC framework question where you have to post code from each of the model, view and controller. That's why I don't like "short" though - such a question would have a both long and concise code sample, I believe.
share|improve this answer
4  
By "complete" I don't mean out-of-production runnable code, but I do mean code that requires practically no effort to get running - the idea is to construct a short program, not to use your program as is or paste some completely out of context part of it that doesn't actually contain the error (the latter can already be closed using this reason, but I think the "complete program" would make that clearer, assuming anyone other than close-voters actually bothers to read these things, though I did voice my concern for the possible abuse). Yes, "concise" could also work. –  Dukeling Dec 13 '13 at 5:10
    
... code that requires practically no effort to get running (if possible) ... (though, if it's not possible, it's arguable whether or not it's appropriate) –  Dukeling Dec 13 '13 at 5:25
2  
The advantage of "short" is that more people will know the word compared to "concise". There is considerable overlap between bad questions and bad writing, so I prefer rules which are easy to understand, even for those with weak English. –  CodesInChaos Dec 13 '13 at 9:28
    
"in an MVC framework question where you have to post code from each of the model, view and controller." There are many situations where it is simply not possible to create an SSCCE. That is one of them. However your answer does indicate to me that you have either not read, or not understood, the SSCCE document, given that and your first comment.. –  Andrew Thompson Dec 13 '13 at 13:16
    
@CodesInChaos You have a very good point - if they're going to ask / have asked a bad question, and happen to find themselves reading this, they're unlikely to look up "concise" if they don't know what it means. Perhaps we should consider sticking to the thousand most used words, where possible. –  Dukeling Dec 14 '13 at 15:03
add comment

Putting the S back in SSCCE

As the author of the SSCCE, I was always deliberately vague as to how long was 'short'. It was originally written when I was a regular contributor to the Usenet news groups, and I figured that over time, what people considered to be 'short' might increase. The main issue then was 'bandwidth to download the group'.

Personally, I'll currently regard 150 lines of code (in code formatted according to the typical language conventions - jumping through no hoops to make it shorter) as 'short'. But that is just a personal opinion.


The Stack Exchange forums seem to allow up to around 650 LOC before we hit a posting limit. That is not only not 'short', but if it were just plain text, I doubt anyone would wade through it.

So what I'm trying to get at is this. I agree that some people post 'self contained' examples that are too long for us to delve into, but that the forum limits themselves should be be lowered, in order to enforce that.

share|improve this answer
    
The problem is that some questions require a lot of code, and others don't. Even at 150 lines of code, most questions can still be cut down about 95% (yes, to like 7 lines), but there may be some good questions requiring more code. You can't really lower the limit enough for the ones that don't without making good questions that do unpostable (without some workaround, likely sacrificing quality), but I do think 650 lines is probably way too much. Perhaps the first step should be working through all questions with more than x (say 150) LOC and checking if there's any true gems there. –  Dukeling Dec 14 '13 at 14:33
    
Given that "short" is a moving target depending on the question, we can't expect the forum limit to help, probably in most cases, i.e. most bad long code dumps I see are shorter than a handful of legitimate good questions with that much code. –  djechlin Dec 14 '13 at 15:14
add comment

The (La)TeX community tends to use the term “minimal working example” (MWE).

From the de.comp.text.tex guide by Christian Faulhammer et al:

2 What are these minimal working examples (MWEs) you keep talking about?

Creating an MWE is a way of tracking down and fixing bugs, as well as of finding the cause of certain behaviour. MWEs must be as small and simple as possible, yet complete, i.e. they accord to the base structure of a LATEX document and can be LATEXed without further additions.

An MWE should be complete and working,

  • so that you cannot accidentally omit information important to diagnosing the problem;
  • so that the person responding can just copy-and-paste the code to try it out.

An MWE should be small,

  • so that responders does not have to concern themselves with long unnecessary lines of code;
  • because it will narrow down possible causes of misbehaviour;
  • because short examples are well suited for posting;
  • because many problems, such as missing brackets, faulty syntax, forgotten switches, etc. will easily be found in the process creating it;
  • because short documents will help you not to lose track of what’s going on.

A few points are of course LaTeX-specific but they are applicable to any programming scenario with minor modifications.

Compared to SSCCE, “minimal” expresses “short” in I think a better way: the point is not so much to hit a length limit as to remove everything that isn't necessary to reproduce the problem. 20 lines of code are too much if 10 of them are useless and not enough if you need 10 lines of include statements, 10 lines to build test data, 10 lines to print out the result, oh and 15 lines of the algorithm you want help with.

“Working” expresses “self-contained, compilable” in a different way that has upsides and downsides. The idea of “working” is to have code that allows the reader to reproduce it, but like “compilable” to a certain extent it isn't always applicable. A question like “why does the compiler reject this code which I think is correct?” won't have compilable code, and obviously if the code was working then there would be no question — the idea of working is to have a document/program that produces some output, the question being how to make it produce different output. I don't think working is the right word here.

So I propose to replace short by minimal. How about “include minimal self-contained code to reproduce it”?

share|improve this answer
1  
I like "self-contained, minimal working example." MWE sounds like a good metric, but self-contained should cut down on the "see my code at www.example.com/foo/bar" questions, too. –  CodeGnome Dec 13 '13 at 14:26
add comment

You must log in to answer this question.

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