4

Getting really annoying to see a lot more questions using codesandbox like this one: Material UI transition out and in on single button click

Why aren't they using the built-in code snippets? There's very little excuse for a JavaScript-based question to be linking to an outside sandbox for running JavaScript code.

Especially annoying when the answer just says "here's the answer in this link!"

What's the recommended way of dealing with this?

2

3 Answers 3

13

The fact that they are linking to an external hosting provider for these snippets is not important on itself.

What matters is that the post (either a question or answer) can stand ot its own two legs without having to follow the external link.

As ancillary material for the post they are fine, and while one would expect users would learn to use the facilities provided by SO, I imagine that for some cases Stack Snippets are not feature rich enough.

  • If an answer consists only of a link, flag as NAA.

  • If all the code a question provides resides at the other side of an external link, vote to close as unclear.

In either case downvoting would be specially fine.

Vote early. Vote often.

1
  • 1
    I would use the close reason "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.", since the "the shortest code necessary to reproduce it " is NOT "in the question itself" Commented Dec 18, 2018 at 16:24
3

To add on to yivi's wonderful answer, just keep in mind the whole goal behind Stack Snippets.

Every question is better for having minimal, reproducible code. Right now the best way to tell people to do that is to point them to JSFiddle, which is off-site. Using this feature, we plan to push new posters to embed runnable code that reproduces their problem.

Similarly, answers that include runnable code are easier to use and understand, because you can try them out. Obviously JSFiddle is hugely popular in answers already, so we just wanted to make it even easier to use.

The question appears to have minimal reproducible code, so the fact that it links to an external service, while mildly annoying, is immaterial. If that site went dark one day we'd still have the code in the question so nothing of value would be lost.

Any answers that are only links, as yivi stated before, flag and downvote, since those could easily disappear because they are not capable of surviving an external site's outage.

-2

The options I can think of are:

  1. down-vote
  2. vote to close
  3. edit the question or answer and move the code over myself from the outside 3rd party JS sandbox to the StackOverflow built-in JS sandbox
  4. ???
2
  • 2
    The problem with option 3 is that third-party sites often have incompatible (more restrictive) licenses than the one Stack Overflow. For example, on JSFiddle the author retains all rights to their code so we shouldn't copy it to SO, which uses the Creative Commons CC-BY-SA license, without permission from the author. meta.stackoverflow.com/questions/344484/…
    – BSMP
    Commented Dec 17, 2018 at 18:50
  • that's a really good point @BSMP didn't consider the licensing issue :/
    – user9903
    Commented Dec 17, 2018 at 18:57

You must log in to answer this question.