14
\$\begingroup\$

On SO, if I include the words "best practice" in the title of a question, I get a message before I even submit the question warning me that the question appears subjective and may be closed.

Could we do something similar here for questions which contain no code? This certainly wouldn't cover all off-topic questions, but there's a fair few like this, which might be filtered out.

The main problem I can see with this is that either the message has to be there the whole time (which might be annoying when you've just started writing a question) or it would only be displayed on moving focus away from the question box. Often I imagine that would be at the moment of clicking the "Post" button which would be too late.

Given how unlikely (impossible?) it is for a question with no code to be valid, potentially we could do something more obtrusive like block submission or showing a modal warning when the "Post" button is clicked.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ It's actually really impossible \$\endgroup\$
    – Vogel612
    Commented Jun 2, 2015 at 12:27
  • 3
    \$\begingroup\$ I guess the other problem is writing a message which is short, but general enough to cover both the "I should have asked this on SO/Programmers" questions and the "Here's a link to my code on github" questions. And which makes it clear for the former category that just adding some hypothetical code won't fix it. \$\endgroup\$ Commented Jun 2, 2015 at 12:30
  • \$\begingroup\$ I think it would be a nice feature, but also really hard to implement. There's only so much automatic reviews can do. \$\endgroup\$
    – Mast Mod
    Commented Jun 2, 2015 at 21:01
  • \$\begingroup\$ @Mast I agree, that's why I picked something that- to me- seems very simple and clear cut. Either there's some text inside a code formatting block or there isn't. Though now that I write this another edge case occurs to me: people writing code but not formatting it properly. \$\endgroup\$ Commented Jun 2, 2015 at 22:48

1 Answer 1

5
\$\begingroup\$

It'd certainly be a very helpful feature, which would also keep as many off-topic questions from being posted. This is a very hard task though, so I'd suggest that we just check to see if there's properly formatted code, or not, and if there isn't, then display a message like this:

It appears that your question contains no code. If you haven't formatted your code correctly, please format it correctly. If your question does contain no code, then it will considered as off-topic. Please refer to the help center to learn what is on, and off-topic.

Or something a little more "word-smithy" along the lines of that.

\$\endgroup\$
1
  • \$\begingroup\$ Good idea! "Most likely off-topic" could be a link to a relevant meta question/help center page with a more full explanation, too. \$\endgroup\$ Commented Sep 17, 2015 at 10:52

You must log in to answer this question.

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