1

As mentioned here, I'd find it useful to have the ability to use stack snippets outside of the question and answer format. The idea would be to implement something very similar to a JSFiddle which we can link to in comments, but with the goal of keeping code-related content on site.

To be clear, this is a feature request and possibly a dupe of this question which is years old and received very little attention. Can we revisit this?

3
  • 1
    I'd like to see a different use case other than the one in the linked question. I don't think it's necessary for users to be able to recreate the exact code in the question itself in the comments just to point out that it works. I want to see where you'd need to comment with code long enough that it should be in a snippet, isn't mostly a rehash of what's in the question, but still isn't useful enough to be an answer.
    – BSMP
    Commented Sep 6, 2018 at 14:58
  • @BSMP - How about when a highly upvoted answer exists and then someone comes along and makes a suggestion to improve it in a comment. I've seen this happen many times - often with comments receiving > 100 upvotes on an already popular answer. The user may not want to edit the answer - and in some cases an edit may not be appropriate, but then we end up with non-formatted code in comments that isn't quite different enough to warrant a new answer. Commented Sep 6, 2018 at 15:27
  • (continued) To make matters worse, there are other issues with copy/pasted code from comments. SO comments are simply not a good place to put code of any significance. Commented Sep 6, 2018 at 15:27

1 Answer 1

5

The inherent problem here is that comments are intended to be brief. A medium-small stack snippet could easily go through the entire 500 characters that you're allowed, which means that linking to it will need to be the way to go.

That leads me to the solution: why not post your snippet on, say, the Formatting Sandbox, and link to that in your comment? Basically, put it somewhere that snippets are allowed, link to that.

1
  • Not a bad idea and while that may be a viable workaround, I'd still like to see something more official. Also, I'd be concerned that content posted there could be removed, breaking existing links. Commented Sep 6, 2018 at 15:19

You must log in to answer this question.

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