4

Today I encountered a new annoying rule:

Oops! Your answer couldn't be submitted because:

Please make your answer complete by including relevant, formatted code inline (don't just link to jsfiddle.net).

What is the purpose of this rule?

If I had a handful of lines of code I would paste it all in the answer, but I am actually trying to convey a full working example that is accessible from a public domain. Why would SO not want me to use this great tool?

EDIT: found this thread discussing this decision. I must say I am very disappointed with this approach, but certainly will make it work.

3
  • 7
    Posts should be more or less self-contained even if all the links break.
    – Mysticial
    Commented Nov 5, 2012 at 4:33
  • I should hope that having a JSFiddle link in addition to the relevant code is acceptable as a more visual reference. Commented Nov 5, 2012 at 5:35
  • 2
    If your "full working example" answer is so big that it can't fit in reasonable post right here in SO, then original question most likely falls to "too localized" category. Commented Nov 5, 2012 at 11:27

2 Answers 2

16

Imagine if you owned a subway shop, and someone came in with their own meat, and asked you to use their meat instead of yours on the sandwich. How would you feel about that?


Posts that rely on an outside link for their primary source of content are generally not allowed on any SE site. In answers, we require that the answer itself contain the answer to the question, with a link to an external site as backup, not the principal source of information. Same with questions; we expect the question itself to be the primary source of information, not an offsite link. This includes links to websites as well as resources like jsfiddle.

There are many reasons for this, but the primary reason is that all such links are temporary. When the link goes down (or the content at that link changes), it renders the question useless to others.

If you can't convey your message with pasted code that fits into a post, perhaps your code is too long. You can't really expect answerers to pore through pages of code in an offsite link and expect to receive comprehensive analysis in a Stack Overflow answer. See http://sscce.org/ for more about this.


Keep in mind that links to jsfiddle are not expressly forbidden, but you are expected to include a code sample with your question, in addition to the fiddle.

17
  • 15
    The point is valid but the analogy is terrible. Commented Nov 5, 2012 at 4:55
  • 2
    What's a better one?
    – user102937
    Commented Nov 5, 2012 at 4:55
  • Can't think of anything... Commented Nov 5, 2012 at 4:56
  • Thank you for your answer. I marked it as useful as an explanation to the rule. I also found a conversation about this very topic, and will add it to my question. .... However I would like to point out that you also found it useful to add links to external resources in your answer (just like me) :). jsfiddle as a tool is very much the SCCE of the SSCCE - the code samples are typically not short -hence the value of the tool. Although I see why this rule was implemented I very much disagree with it to an Nth degree.
    – DmitryB
    Commented Nov 5, 2012 at 4:56
  • 3
    Yes, but the links in this answer are not the primary source of information in the answer. The answer still works perfectly well without the links. But just a link to a Fiddle containing the code that is relevant to the post does not work. If the fiddle dies, so does the post.
    – user102937
    Commented Nov 5, 2012 at 4:57
  • and if the SO dies... then what?
    – DmitryB
    Commented Nov 5, 2012 at 5:07
  • 10
    @DmitryB Then people aren't going to be reading the post thinking "damn, this sounded useful, if only I could see the code", because they can't see the post anymore. Commented Nov 5, 2012 at 5:09
  • @DmitryB - If SO dies, then it doesn't matter then. ;)
    – jmort253
    Commented Nov 5, 2012 at 5:10
  • @DmitryB - Again, to clarify, you can still use the jsFiddle to show a complete, working example, but you ALSO must include the important bits of that code in the answer. No one is banning jsFiddle or saying it's not useful, just that it can't be the only thing in your post. Hope this helps!
    – jmort253
    Commented Nov 5, 2012 at 5:11
  • 1
    If it was Subway they should take it "have it your way" or is that Burger King?
    – random
    Commented Nov 5, 2012 at 5:13
  • The problem is sometimes you need to demostrate the results and sometimes that's all that's relevant to the issue, not the code. If you don't want people posting on jsfiddle.net then add the ability to embed running JavaScript in an answer. (example: stackoverflow.com/questions/13699321/…)
    – gman
    Commented Dec 5, 2012 at 11:33
  • @gman: If you're referring to posting answers, only the lines of code that changed need to be included in the answer, if the OP posted a complete, working code sample in their question. Code is always relevant to the question.
    – user102937
    Commented Dec 5, 2012 at 16:20
  • Did you even look at the issue referenced? Code is not always relevant. The question did not require any code. The answer did not require any code. The answer included a reference to a jsfiddle to show an issue with any possible solution.
    – gman
    Commented Dec 6, 2012 at 8:51
  • @gman: Eh, if it's a Fiddle, it's code. If it's code, the relevant portion belongs in the post itself.
    – user102937
    Commented Dec 6, 2012 at 16:06
  • We'll just have to disagree. The point of the fiddle is not the code. the point is the strange shape that gets drawn
    – gman
    Commented Dec 7, 2012 at 6:37
4

The main reason behind this is because of this question:

Prevent posts with links to jsfiddle and no code

That question post will answer What is the propose of this rule?

Now, when the body length is checked, is does not count any links. Quoting an answer from Kevin

we've changed the minimum body length check to not count anything in the form of a link (doesn't matter to what or whether they're even actually anchors when rendered). We'll be keeping an eye on things to see if the minimum length needs to be raised (it's currently at 30, which I think is a little short personally).

And

So, from now on, if you try and post to Stack Overflow with a link to either jsfiddle.net or ideone.com you'll be required to include some properly formatted code as well. We do special case direct links to their home pages, so you can still mention http://jsfiddle.net/.

2
  • It's a little more involved than that... They did make that change, but then decided that it wasn't enough. Keep reading after the part you quoted.
    – user102937
    Commented Nov 5, 2012 at 6:34
  • @RobertHarvey, Oh yes, I should have included that too. Updated thanks.
    – Starx
    Commented Nov 5, 2012 at 6:42

You must log in to answer this question.

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