Why is it since a few weeks no longer possible to answer questions without providing a code snippet?

Some questions, especially many beginner questions, can be answered without providing a code snippet, because the underlying issue is actually not related to the code snippet the OP provided.

Sometimes it is easier to link to a github repository, jsfiddle, jsbin, etc. containing the necessary code or code changes to help the OP.

It feels a bit odd posting a few lines of code just to be able to provide the right answer, knowing that the proper answer in code would be a very lengthy snippet; I was under the impression that it is better to link to somewhere where the OP and the one answering - as well as others - can tinker with it to see how changes lead to the right solution?

  • Is this true? My last two answers have no code in them. – Mysticial Oct 26 '12 at 23:39
  • 3
    Since a few weeks? Ah, you probably mean the recent changes that prevent links to jsFiddle from being posted without the code therein also being posted in the question or answer itself? If that's the case, well, maybe you should post that code as well as linking to it. – Frédéric Hamidi Oct 26 '12 at 23:46
  • @Frédéric Yes, that's what I mean. Now having to post the actual code of a lengthy jsfiddle will blow up the answer beyond proportions. Or having to post hundreds of lines of code from somebody's website development sandbox. I understand that it is a good idea to take measures that - hopefully - improve the quality of answers, but I'm not sure if massive code posting is helping in that respect. – Systembolaget Oct 27 '12 at 9:26
  • @Mystical That's strange. Whenever since a few weeks I'm linking to a sandbox, jsfiddle, etc. I get a message below my answer-to-be that I must provide code. So, sometimes I just add a line of code just to post the right answer which is mainly textual, but that feels wrong, too. – Systembolaget Oct 27 '12 at 9:28

You can post an answer without code. You just can't post an answer that has code, but only somewhere outside the answer.

Show code, or show code not. There is no jsfiddle.

Links to the code make for link rot, crappy searchability, and generally a bad user experience. Paste it in or leave the question for someone else to answer. If you want the interactive experience too, that's cool - but if the code that answers the question isn't in your answer, you're not helping.

  • Yes, but very often, at least on some jQuery plugins where I provide most answers, the question can easily be answered textually, because the OP made a mistake that is actually not so much code-related but rather to her/his approach. – Systembolaget Oct 27 '12 at 9:30
  • 1
    Absolutely! Some of my best SO answers have no code. There's nothing wrong with that at all. What the system prevents is linking to something that exists for code (eg jsfiddle) meaning you are using code to answer, but not including any of that code in the answer here on SO. Show code not is an honourable choice for many questions. – Kate Gregory Oct 27 '12 at 12:22

I can post a pure text answer, an empty answer, but if there's a link to jsfiddle, all hell breaks loose.


This stupid. A simple workaround: add ticks to a random word.

  • 1
    The reason the system restricts jsFiddle is because it forces users to leave Stack Overflow. On a site for expert and enthusiast programmers, sending people someplace else is contrary to making Stack Overflow the last stop in the search for a solid answer. In general, it's okay to add links, but the links should support the code that is in the actual answer. – jmort253 Oct 27 '12 at 0:36
  • What if my answer is supported by a jsFiddle snippet but complete without code? – Fiddler On The Roof Oct 27 '12 at 0:37
  • 1
    Users shouldn't have to leave the site to get their answer. If they have to visit the link in order to determine if your answer is helpful, then the answer either needs to be edited and improved, downvoted, or possibly flagged as not an answer and removed. Here at Stack Overflow, we try really hard to be better than just some random-snapshot-of-the-Internet forum and strive to help future visitors. Hope this helps. – jmort253 Oct 27 '12 at 0:39
  • 3
    @Fiddler, then it is not complete. What if something happens to jsFiddle? As I keep saying, time and time again on SO itself, Stack Overflow aims to be self-contained. Code in your question or answer is better than two in the bush. Or something. – Frédéric Hamidi Oct 27 '12 at 0:40
  • 15
    YES! They implemented the link-only-to-a-jsfiddle block! \o/ – user102937 Oct 27 '12 at 1:11
  • @jmort253 Well, then maybe in the future there should be SO's own interactive sandbox? Interactive examples are just so very helpful in the realm of HTML/CSS/jQuery especially to novices. – Systembolaget Oct 27 '12 at 9:33

You must log in to answer this question.

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