10
\$\begingroup\$

Stack Snippets are runnable JS/CSS/HTML codeblocks within the questions/answers that have recently been implemented on StackOverflow.

I don't know as there are enough HTML5 game development questions to warrant the feature, but this question brought the feature to mind, and I thought it might be something useful to have. Especially to mitigate dead links to fiddles or pens in those instances.

It might also be useful for explaining or showing certain algorithms; e.g. how to layer octaves of noise for PCG and a resulting visualization. Or for GLSL/OpenGL questions that can be implemented within the subset of WebGL.

\$\endgroup\$
7
  • \$\begingroup\$ Note: I couldn't find an existing feature-request. Doesn't mean there isn't one, I just couldn't find it. \$\endgroup\$ Dec 1, 2014 at 19:44
  • \$\begingroup\$ -1 for that will encourage code dumps instead of pinpoint code snippets. \$\endgroup\$
    – Kromster
    Dec 2, 2014 at 11:52
  • 2
    \$\begingroup\$ @KromStern, would it though? People already dump code...often without even formatting it. I'd like to think that those who are going to dump already do. \$\endgroup\$ Dec 2, 2014 at 16:34
  • 1
    \$\begingroup\$ I'm on the fence, but I'd encourage anybody who has an opinion to vote this up or down accordingly and/or post an answer detailing their position. \$\endgroup\$
    – user1430
    Dec 3, 2014 at 17:15
  • \$\begingroup\$ Is stack snippets really something we can just enable or will it get shot down by SE like latex support? I don't fully understand the circumstances around each of the technologies so I'm asking out of curiosity. \$\endgroup\$ Dec 4, 2014 at 18:12
  • \$\begingroup\$ @SpartanDonut From the SE blog post about them, almost at the end: "If you feel that a particular site should have Stack Snippets, post a feature-request on that site’s meta – if there’s support from the community there, we’ll enable them." To my understanding, if we can make a good case and garner significant community support (and I think we can), the Ancient Wizards will take notice and call upon the necessary magicks. (Moderators probably have the details?) \$\endgroup\$
    – Anko
    Dec 4, 2014 at 21:16
  • 1
    \$\begingroup\$ I have no details beyond what's in that post. However, it looks like we have a pretty solid consensus for "yes," so I'll try to bring this to the attention of a community manager. \$\endgroup\$
    – user1430
    Dec 5, 2014 at 1:49

3 Answers 3

13
\$\begingroup\$

Poof! You have Stack Snippets. Now get out there and do some awesome stuff with them! ;)

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Thanks for the swift response. \$\endgroup\$
    – user1430
    Dec 5, 2014 at 16:41
11
\$\begingroup\$

Yes please

Games are interactive, so questions about them are often about interactivity. Stack Snippets allow interactive demonstrations.

Currently, when I write about something interactive (like splashy waves, brushable hair or mouse following), I tend to post a bunch of pictures (often GIFs of my cursor poking things), followed by the code I used to produce them.

Stack Snippets would let people just try the thing.


Look, here's a demo of a foolproof physics engine: Got your nose!

(Well… it could have been!)

Interesting: Tetris and Rogue clones in Snippets.

\$\endgroup\$
10
\$\begingroup\$

After some further though I don't really see any reason we would not want these. Yes, you can make an argument that it will "encourage" code dumps, but we don't allow those, so the existing moderation venues should handle that just fine.

If anything, perhaps the quality of code dump questions will improve slightly (since the snippet won't run if the code is bad) and we'll be able to relax the restrictions on debug-my-code questions somewhat (provided a snippet demonstrating the issue can be provided, maybe?).

So I'm for them.

\$\endgroup\$

You must log in to answer this question.

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