-6

The concept of adding JSFiddle integration has been discussed in: Custom jsFiddle for Stack Overflow

While adding it sounds like a lot of work, at any moment JSFiddle could change its terms of service, or close which would cause a lot of dead links. I realize we do not allow JSFiddle links without any code but often the fiddle still contains the vast majority of the code.

In that post, the website author describes a simple method for grabbing the code from a JSFiddle question. (by adding /show_js /show_css etc).

The Feature Request:

Can Stack Overflow store copies of content of fiddles posted in questions/answers in case there is a problem with the service in the future?

We can figure out in what way to show them later, but I think the data should be backed up just in case given how many questions sport it extensively. While doing the same for JSBin, codepen and other services sounds interesting, JSFiddle seems the largest by far in terms of use in SO questions and I think it's a higher priority.

Edit

Some people are saying that questions shouldn't rely on JSFiddle, which I don't get at all since that's like saying "we shouldn't be having this problem in the first place". Well, we have this problem, there are easily thousands of questions that contain vital information in JSFiddle links. All I'm suggesting is not digging a deeper hole.

  • 1
    It's a good idea, I honestly don't think it will ever happen, maybe it would have to be a 3rd party that does it. – iConnor Mar 13 '14 at 23:58
7

I post a lot of answers that contain jsfiddle.net links and I don't think this is a good idea for various reasons:

  • A lot of the stuff in a fiddle is going to be noisy boilerplate. For example, if you're demonstrating a Backbone technique, you'll usually need a stubbed model and collection, a couple views, some templates, and maybe some CSS; most of that stuff is supporting noise that is peripheral to the answer.
  • Answers should be self-contained. Everything you need to understand the answer should be within the answer itself: that includes code and even excerpts from documentation and standards.
  • A jsfiddle.net (or sqlfiddle.com) link is provided to illustrate the answer, to let someone watch it in action and fiddle around with it. The fiddle itself is useless without the explanation in the answer; if the answer doesn't have any explanation then it isn't a very good answer and we shouldn't be overly concerned with it.
  • The big advantage of jsfiddle.net/sqlfiddle.com/ideone.com/jsbin.com/... links is that they run: you follow the link, hit a button, and the code executes right before your eyes. That's not going to happen on SO.
  • There are all kinds of off-site resources that people link to (standards, documentation, ...), should SO copy them too?
  • What would happen if the answer was edited and the jsfiddle.net link was removed or changed? The answer system would need to know which part of the answer was automatically extracted from jsfiddle.net so that the answer could be updated to reflect the jsfiddle.net update.
  • What would happen with the External Resources from the jsfiddle.net sidebar?

Seems like an awful lot of special casing for little to no benefit.

  • 1
    I really don't really understand the argument here against keeping a copy. While I agree questions should stand on their own in Stack Overflow some don't and contain a lot of interesting information from jsfiddle. I'm really not sure why we wouldn't want to have that for a rainy day. – Benjamin Gruenbaum Mar 14 '14 at 15:58
  • 1
    I guess the argument boils down to the request being a lot of special case work (including a couple additions I just made) for little to no benefit. If you're worried about rainy days then encourage people to provide proper answers rather than trying to work around their laziness with brittle hacks. – mu is too short Mar 14 '14 at 17:12
5

Interesting idea, but I'm downvoting because I think it moves significantly away from the core competency of Stack Overflow.

We are not a "test your code" website - we are a question/answer website.

YMMV :)

  • I don't understand how this is relevant to the issue. I'm merely suggesting backing that information up for a harsh day - how is that "moving away from the core competency"? – Benjamin Gruenbaum Mar 13 '14 at 23:58
  • 1
    @BenjaminGruenbaum I do agree in that respect, if fiddle goes down, the quality of Stackoverflow would decrease a little. – iConnor Mar 13 '14 at 23:59
  • 9
    I feel like the solution here is to post your code in your answer instead of throwing in a jsfiddle link and calling it done. We're not really in the business of storing/running everyone's little javascript snippet. jsfiddle is a nice to have but should not be in any way essential to any answers. – Adam Lear Mar 14 '14 at 0:00
  • @AnnaLear why not? It's supposed to be a good source of information. – iConnor Mar 14 '14 at 0:01
  • @Pinocchio I just edited my previous comment a bit. I'm on board with folks using jsfiddle to support their answers (kinda like including a demo of their solution), but it's not strictly speaking required or necessary. Why do we need to duplicate it? – Adam Lear Mar 14 '14 at 0:02
  • 8
    Basically, there's already a way to "store copies of content of fiddles posted in questions/answers". It's "including the code in your answer in the first place". :) – Adam Lear Mar 14 '14 at 0:03
  • @AnnaLear it's either that or make it easier / be more supportive of people editing posts and adding the jsfiddle content in, which would currently be classed as an invalid edit by the majority – iConnor Mar 14 '14 at 0:03
  • @Pinocchio Would it, really? People do tend to be hesitant to approve edits that include code, but I'd like to see how many of those rejected edits include a summary along the lines of "included code from jsfiddle to prevent link rot". – Adam Lear Mar 14 '14 at 0:04
  • 1
    @AnnaLear how many people do you see that do those kind of edits? – iConnor Mar 14 '14 at 0:06
  • @AnnaLear while I completely agree that optimally answers should include the essential parts in the answer de facto many answers do include some code in the answer and the working example as a fiddle. I'm not saying it's optimal, but it's the case with answers I run into every day - having that info in a rainy day sounds very useful to me. – Benjamin Gruenbaum Mar 14 '14 at 0:06
  • @Pinocchio Hmm? You're the one saying edits that include code from jsfiddle would be rejected. Are you saying they don't happen? That's a different problem. – Adam Lear Mar 14 '14 at 0:07
  • @BenjaminGruenbaum That sounds like a great reason to edit the answer to make it better. – Adam Lear Mar 14 '14 at 0:07
  • 4
    @AnnaLear my point is they don't happen because either they would get rejected or people get the impression that it would get rejected. Maybe it needs to be made clear to the reviewers and editors that this is allowed and encouraged, I would have probably done this a couple hundred times since iv'e been here, had I known it was a valid edit. – iConnor Mar 14 '14 at 0:09
  • 1
    @Pinocchio Sure, but that's not a good reason to implement a jsfiddle mirror. :) – Adam Lear Mar 14 '14 at 0:16
  • 1
    @BoltClock'saUnicorn but they do exist and people do use them all the time. I can easily find hundreds of questions that include some code in the question but a lot of interesting and relevant code in JSFiddle. – Benjamin Gruenbaum Mar 14 '14 at 16:02

You must log in to answer this question.

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