-12

When I was writing this answer, I found that the OP's code was correct; he was just using an old version of a library. I wrote an answer saying so and wanted to link to an updated version of the OP's jsfiddle to demonstrate, but ran across this error:

Links to jsfiddle.net must be accompanied by code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

screenshot of jsfiddle error


I wrote literally no code and thus had none that I could put in my answer. I ended up putting the jsfiddle link in a comment instead. I heartily approve of the warning, but it would be nice if there was some way to bypass it, especially for users with high rep.

3 Answers 3

19

As you know, the reason we don't allow submissions with fiddle links without including code is because nearly every post that includes a fiddle does so because it involves code that is relevant to the post at hand and therefore needs to live in the post itself.

I see far more cases of users, even high-rep ones, omitting the code where they didn't have a valid reason to, than cases where, for example, including any code would actually be pointless (e.g. if the code changes are either insignificant or obvious, or as in your case, no code is involved). So I'm not comfortable with the idea of lifting the restriction, because we'll probably just end up seeing even more link-only posts.

In situations like this, I'd just not include a fiddle link at all. Like you said, your answer is self-explanatory. Not everything requires a fiddle.

2
  • I'm sorry to ask, but could you please give a link where the original proposal for this rule was given? I'd like to read the discussion there, because I have the exactly opposite sentiment (I'd like the code to be kept OUT of the questions, unless it's less than, say, 5 lines long).
    – Vilx-
    Commented May 30, 2015 at 23:46
  • @Vilx-: Here it is: meta.stackexchange.com/questions/149890/…
    – BoltClock Mod
    Commented May 31, 2015 at 3:22
6

Bare links to external sources are useless, this is a good rule!

Links without code on the site, are useless to future visitors because SO doesn't have control over when those links go dead.

Not just for JSFiddle but any thing external to the site should be on the site.

The links might not go dead and might end up pointing to wrong information or worse, spam and the like if the domain goes dead and get bought up by a domain hoarder.

I like to work up solutions in my IDE, test them and then post them, I also put them in a gist on GitHub or in my dedicated StackOverflow repository.

I still post the code inline in the answer because, hey I might get hit by a bus one day and my accounts get closed or whatever other random thing might happen.

4
  • My answer stands alone without the jsfiddle link. The jsfiddle link makes the answer more useful and as I said in the question, I've already included all the information from the jsfiddle in my answer. Commented Aug 20, 2014 at 2:03
  • If I wrote code, I'd be happy to include it in my answer. I wrote literally no code for my answer and so it's impossible for me to have copied it in; I only changed the JSFiddle settings from what the question contained. Commented Aug 20, 2014 at 2:06
  • a screen shot of what settings you changed would have been better than the link anyway.
    – user177800
    Commented Aug 20, 2014 at 2:10
  • Perhaps including an image would have improved my answer, but including the jsfiddle link is still more useful than not including it, everything else equal, yet there's no way for me to do so without providing code (of which I have none!). Commented Aug 20, 2014 at 2:12
3

Code absolutely would help that answer. You're calling out a certain portion of the question code descriptively "reuse of component descriptors". There's nothing at all from preventing you from pulling an example of the code that is breaking on old React from the question into your answer.

There is no rule that code in an answer needs to be self-written. It is often very helpful to pull bits from the question and explain them. A new programmer would have a terrible time if I had described that code abstractly ("reading from a stream to a memory location controlled by an uninitialized pointer"), because they likely don't have the level of understanding to match the description with the code.

You must log in to answer this question.

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