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

I think something should be added at the very least to the right side of the "Ask A Question" page of Stackoverflow encouraging users to provide code if at all relevant to their problem. It happens way too often that someone posts 1 paragraph of "my code is not working, how do I fix it?" with no code in sight. Some kind of nudge towards the fact we're all programmers here and code is the easiest way to see a problem would be nice.

A little past that, it would be nice if that section was somehow "highlighted" for new users, as sadly enough it seems like people just kind of block that right side out when posting questions.

share|improve this question
    
What would also be nice is features to indent/unindent blocks of code. This would solve issues when copy/pasting code snippets from nested loops/conditionals, and copy/pasting if you use tabs over spaces –  Macha Aug 2 '09 at 22:16
1  
That would IMHO result in one-paragraph questions ,,my code is not working, how do I fix it'' with copy-pasted 3KLOC spaghetti-style source code that might or might not be relevant. We shall encourage our users to think, which is hard (both making people think and thinking itself). –  Tadeusz A. Kadłubowski Aug 3 '09 at 8:08
    
tkadlubo: why on earth would someone try to deceive others as to what code applies to their problem? –  Paolo Bergantino Aug 3 '09 at 14:42

2 Answers 2

It would be really cool if we could do something like Google Mail does with attachments. If it thinks you meant to include an attachment but accidentally haven't, and you hit send, it will prompt you to check whether or not you really want to send. That's saved me from an embarrassing follow-up email a couple of times.

Now obviously the Google Mail team have rather more manpower than SO for text analysis, but it would be nice if SO could guess if your question would be clearer with code, or (possibly easier to spot and just as important) if you should include the text of an error message. "I get an error" or "it doesn't work" are two phrases which almost always mean the question won't be answerable without more information.

I suspect this is a pie-in-the-sky idea, but it would be so handy :)

share|improve this answer
1  
I thought about suggesting that, but it is indeed a little farther than I think they'd be willing to go :) I definitely thinks a nudge is needed, though. –  Paolo Bergantino Aug 2 '09 at 21:11

Separate (but related) idea to my other answer... provide a better hint of how to post code.

I frequently go into questions, select a block of text and hit Ctrl-K - no extra work really needed, but the difference in legibility is staggering!

Often I suspect we could detect code posted in this form... if there are several lines ending with a semi-colon, for example, that would be a pretty strong indicator for quite a few languages. I'd stop short of getting it to suggest exactly where it should reformat it, but a pop-up with a very short example (including text before and after) would be really useful.

share|improve this answer

You must log in to answer this question.

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