17

The question Adding perfect squares to get input isn't a particularly good question, but it does show the 'Run code snippet' button:

Showing C code and 'Run code snippet' button for SO 26331706

However, pressing the button doesn't do anything very useful except format the code on one line since there isn't any HTML lurking around.

Why is the system offering to run a C program when it doesn't know how to compile and run C programs?


Answer: it seems to be user confusion (error, except that the error arises because the user doesn't understand what the snippets system is for).

For the question referenced, I've removed the snippet-related markup.

3
  • 5
    I've seen quite a few of these over the past few days - it's a pain having to keep editing them out.
    – Paul R
    Commented Oct 13, 2014 at 9:04
  • 1
    A question that contains an edit Answer: .. ... Meta does work different!
    – Jongware
    Commented Oct 17, 2014 at 10:06
  • I've run into one today. Maybe the "code snippet" UI should be renamed to something more explicit so it's obvious that C code samples are not "snippets". I suspect the average user is not aware of the difference. Commented Dec 22, 2014 at 14:06

1 Answer 1

11

It's because people click the wrong button - they create a stack snippet rather than a regular code block. It prompts for stuff in javascript, but people can put anything in there if they want.

I mean there is nothing stopping me from typing regular text as a stack snippet; people might put their code wherever they want.  

In these cases I usually edit the post to remove the snippet, as it doesn't make sense to have it like that.

2
  • 4
    OK; I see. I've not bothered to look hard at snippets because it doesn't support the languages I know well enough to answer questions about. Yes, it is easy enough to remove the markup for snippets. I'm left wondering if the system should be able to spot that there's a problem for itself (like 'no tags in the HTML code')? Commented Oct 13, 2014 at 4:40
  • 3
    Yes, the system should spot this. Commented Jun 15, 2015 at 16:13

You must log in to answer this question.

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