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

Disclaimer: This only really applies to Stack Overflow at the moment, though I think something similar may apply to the other sites as well.

Disclaimer 2: I seem to be advocating nudge theory, woe is me.

I've been playing around on data.se; looking at a simplistic metric, whether a question includes code, to see whether there would be a simple way of increasing the overall quality of questions and answers on Stack Overflow.

It only includes questions from the 30 days prior to the latest dump - 2012-03-14 02:20:00 - as questions with a score <= -1 are deleted after 30 days. I've ignored completely any edits made, which means the majority of the questions are counted after the SO community has clicked {} for those people who can't be bothered to read. I've also restricted it to questions with a view count > 10 to weed out any outliers.

Some Definitions:

  • good question: more up-votes than down-votes and not closed
  • bad question: more down-votes than up-votes or closed.
  • meh question: as many up-votes as down-votes, i.e. a score of 0.
  • good answer: one that has more up-votes than down-votes or one that has been accepted.
  • bad answer: not a good answer.
  • code: body of the question currently has the <code> tag. For those who don't know both a backtick and 4 spaces are converted into the <code> tag.

The Queries:

If we look at questions vs. code it's fairly obvious that the questions are much more likely to be classed as good if code is included ≈ 2.3 times more likely.There's very little difference in the bad area as, I suspect, a bad question is a bad question. They could also all be "please debug my code".

    GoodQuestion IncludesCode Count     
    ------------ ------------ -----     
    meh          no           30629     
    meh          yes          56101     
    no           yes          6314      
    no           no           6664      
    yes          no           14923     
    yes          yes          34643 

When you compare answers vs. code the difference is just as pronounced. There are 2.5 times as many good answers on a question with code than one without. It's important to note that there can be many questions per answer in this query. As I said this is a simplistic analysis, so the 53,877 "bad" answers on a question that includes code could mean anything, more important, I think, is the fact that this is only 55% of the number of good answers on a question that does.

    GoodAnswer IncludesCode Count     
    ---------- ------------ -----     
    no         no           25428     
    no         yes          53877     
    yes        no           38110     
    yes        yes          97584 

Comparing closure vs. the inclusion of code, 65% of all questions that get closed don't have any code in them. For this query I had no restrictions on views or anything.

    Closed IncludesCode Count     
    ------ ------------ -----     
    no     no           51393     
    no     yes          96634     
    yes    no           3845      
    yes    yes          2309  

My Suggestion:

Make it more "difficult" for people to post. Bring up a Big-Red-Boxy-Thing TM and make them click not once but thrice - Post Your Question, dismiss, Post Your Question - and hopefully some will pay attention. The fact that there's no code could of course be completely correct, in which case people could just click those extra two times and no harm done.

I don't know whether it's done at the moment, but this would also be a good place to run the low quality post algorithm and raise another box if it is.

Yell at people

share|improve this question
1  
That's a pretty vicious colour. –  Daniel Fischer Mar 23 '12 at 16:34
10  
I would upvote this but I can no longer read after having seen that image. If you somehow missed it and still have your vision, please tell my wife I love her and send help. –  K.G. Mar 23 '12 at 16:36
    
I think visciousness is the idea... –  Cody Gray Mar 23 '12 at 16:36
    
Thank you all for your comments about the colour :-); +1 @K.G. for making me chuckle. It was intentional and could of course be toned down; I did this with paint :-( –  ben is uǝq backwards Mar 23 '12 at 16:37
1  
MY EYES!! –  cdeszaq Mar 23 '12 at 16:42
1  
+1 for a good idea. -1 because it will result in idiots slapping walls of code in their questions. –  Won't Mar 23 '12 at 18:45
1  
@Won't, in that case you have yet another script that checks that less than x% of the post is code :-) ( joke ). –  ben is uǝq backwards Mar 23 '12 at 18:50

2 Answers 2

I think this is a lot more likely to actually work than the previous suggestions to add a line about code to the FAQ or the sidebar of the "Ask Question" page. I've certainly been where you are, trying to answer questions where the source code should have been included but wasn't, and in those cases, I'd be all for an invasive and visually obnoxious prompt at the time of question submission.

...But, not all good questions on Stack Overflow require or even should include source code. Yes, a lot of them would benefit from showing code, but this is not something that we want to antagonize users with in those situations where it doesn't make sense to show code.

Exacerbating this problem further is the fact that it tends to be experienced, expert users who post questions that would not benefit from the inclusion of code. They really aren't the ones we want to be treating in a hostile manner with such error messages. We should trust that they know what they're doing, and if they don't think adding source code would enhance the quality of the question, then we should not second-guess them algorithmically.

Now, of course, you could always argue that we should work around that by only enabling this code presence auto-detection for users below a certain reputation level. That obviously solves the problem of pissing off expert users, but it doesn't solve the more general problem that not all good programming questions actually require or benefit from the inclusion of code. Even the expert users were new users at some point, and we shouldn't have different standards for the types of questions that we allow, depending solely upon your experience level.

share|improve this answer
    
If the Pester Screen of Death +1 were merely a suggestion, however, couldn't people dismiss it with a link that said something to the effect of "This question does not involve code" or something? –  K.G. Mar 23 '12 at 16:46
1  
Perhaps Established Users skip the flashbang? –  user7116 Mar 23 '12 at 16:47
1  
@K.G. The problem is that you called it the "Pester Screen of Death". That indicates it's an extremely user-hostile feature. The fact that you can opt-out doesn't justify its inclusion. –  Cody Gray Mar 23 '12 at 16:47
    
@six: read the next paragraph –  Cody Gray Mar 23 '12 at 16:48
    
Backticks are marked-up as <code>, what are the chances of an experienced user not having a single one in their post? I'll edit my question to include this. –  ben is uǝq backwards Mar 23 '12 at 16:50
    
@CodyGray: yeah, just suggesting a good Rep Level to start it at. Granted some of the repeat question asking offenders are at that level... –  user7116 Mar 23 '12 at 16:55

Totally no. Don't rule me in the my way, manage your kids. Can't downvote, but really want for idea and damned bright color

share|improve this answer

You must log in to answer this question.

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