37

For JavaScript related questions, most of the code is posted on jsFiddle and other similar web sites. Also, answers are posted in jsFiddle, modified from the original questions.

It just dawned on me that if these sites go offline permanently without any successor, the questions and answers would have lost relevant information.

Is my concern reasonable? If so, what should we do to prevent such possible loss of significant information?

Update

The discussion on Are answers that just contain links elsewhere really "good answers"? contains a better discussion on the issue I've raised.

3

4 Answers 4

32

The questions and answers should stand alone without those jsfiddle links (or similar). These links should only serve to have a "live-demo" of the problem to make it easier for everyone to understand (and play with) the problem.

If a question or answer would be rendered useless if the link went dead, it needs to be fixed by copying the relevant parts of those examples into the post itself.

3
  • 9
    ...or the author needs to be "fixed" by a comment, or downvote.
    – Arjan
    Commented Dec 6, 2011 at 7:54
  • 1
    ... but DO NOT copy code if it isn't obvious that you are allowed to move the code into the Creative Commons license SO uses (for example, if it clearly states a compatible license on the jsFiddle page). Consider copyright and licensing issues carefully before copying code written by others into any post. Commented Jun 20, 2012 at 16:31
  • @EmilVikström I'd be surprised if there's any legal precedent for anyone doing such a minor thing getting into trouble for it. Unless you're copying code from an employer's codebase (and that employer is really the nit-picker), getting to court seems extremely unlikely and I doubt it ever happened. Commented Sep 18, 2014 at 7:45
6

Reasonable concern indeed. I always post all the code here, and use jsFiddle as "live test case", nothing more.

As Mat already said, posts with links to jsFiddle or similar sites that contain no code should be edited, I'll try to add my 0.02 on this:

  • In case of simple or short code (e.g. only some lines of JS) just copy the whole thing to the post (before the link) adding proper edit comment.
  • In case of complex code, code that also involve HTML and CSS or parts that are not relevant to the question, you better put comment and let the post author copy just the relevant parts. We're in no hurry, can't see jsFiddle or jsBin going down any time soon.
  • In case of the above and you check up few days later and post author didn't respond, try deciding yourself what might be relevant, but that's something better avoided, if only for being time consuming on your part.
4

Personally, I'd close and delete any post that requires a user go to an off-site location. The problem is that the javascript community here is all about jsfiddle, and would probably throw a sh.. fit if I went rampaging through their tag. So I haven't been paying as much attention to it as I probably should have.

Something does need to be done. Perhaps banning jsfiddle is the first step.

8
  • If you ban the fiddle then there is no real place for the js so users to post demos (same for jsbin, codepad, etc)
    – Naftali
    Commented Dec 6, 2011 at 16:15
  • 1
    @AManAPlanACanalPanama: When the URL rots the post is worthless.
    – user1228
    Commented Dec 6, 2011 at 16:26
  • So should there be a feature request for SE fiddle type sites?
    – Naftali
    Commented Dec 6, 2011 at 16:27
  • Feature request made: meta.stackexchange.com/q/114996/155556
    – Naftali
    Commented Dec 6, 2011 at 16:29
  • 1
    @AManAPlanACanalPanama: A viable, but probably unlikely, solution.
    – user1228
    Commented Dec 6, 2011 at 16:31
  • True, but it is worth the try.
    – Naftali
    Commented Dec 6, 2011 at 16:31
  • Please don't block jsFiddle - why punish those who use it correctly? It give perfect playground for all sort of stuff and save hours of trying to explain things in mere words. Commented Dec 7, 2011 at 8:26
  • 1
    @_Won't - I totally disagree with banning it, as you can see from huge number of answers from me on SO it's a great live-demo site. I agree answers should stand on their own...and all code is in my answers, with a link to test it out quickly, if the jsfiddle dies, only the "test it immediately is gone, the answer's still completely useful. If it's a link-only answer then this is just a specific form of that problem, and I agree those aren't really answers, not in the long run.
    – Nick Craver Mod
    Commented Dec 7, 2011 at 11:19
1

Not sure if an answer is the correct place for a feature request but here goes:

Given how useful fiddle is at what it does, the real issue is links to users fiddle accounts that may become dead over time. This would/could be resolved if these fiddles were migrated to an SO fiddle account where the links could be made more permanent. I realize there are a host of other issues here, but the ability to provide examples of functionality and also demo an answer is a huge value add to SO, and would be nice if that component of questions and answers were not lost over time.

You must log in to answer this question.

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