23

In the past few days I've posted a (now undeleted) answer to Stack Snippets Sandbox - Try It Out Here!

Here's a copy-paste of the snippet for the curious:

<?php                                                                                                               ?><script>
    $store = array(0, 1, 0, 1, 0, 0);                                                                               function array(){ return [].slice.apply(arguments) }var preg_replace=function(regex,w,str){var re=regex.split('/').splice(1,2);re[1]+='g';return str.replace(RegExp.apply(0,re),w)},str_split=function(s,n){var a=[],n=n||1;for(var i=0;i<s.length;i+=n)a.push(s[i]);return a;},implode=function(w,a){return a.join(w)},var_dump=function(t){document.write((typeof t=='object'?(t.length>-1?'array':'object'):typeof t)+(t.length!==void 0?'('+t.length+')':'')+' '+JSON.stringify(t).replace(/\[/,'{').replace(/\]/,'}').replace(/,([^,])/g,', $1'))},styl=document.createElement('style');styl.innerHTML='body{font-family:monospace}';document.head.appendChild(styl);
    $check = str_split(preg_replace('/10/','1',implode('',$store)));
    var_dump($check);                                                                                               </script><?php
?>

To my understanding, the sandbox can be used to try out the feature indefinitely, but I was told by the commenter that it's a "spammy answer bumping an old post". All I wanted to do was link the answer in my profile.

So my question is, what's the general time limit we are allowed to use past and future sandboxes for that pop up for new features? Does posting an answer so late count as spam and should be nuked on sight?

8
  • 8
    FYI, Stack Snippets don't support PHP. Commented Feb 6, 2015 at 22:40
  • 12
    @ThisSuitIsBlackNot That scrollbar's there for a reason (there's JS that makes the snippet work like it's php but it's hidden without scrolling right). I've edited the snippet into this question.
    – SeinopSys
    Commented Feb 6, 2015 at 22:42
  • 26
    And this is why I hate horizontal scrollbars in code. Commented Feb 6, 2015 at 22:45
  • @ThisSuitIsBlackNot: He knows. Look at the code. Commented Feb 7, 2015 at 23:22
  • The scrollbar doesn't even show on Mac Chrome. xD Commented Feb 8, 2015 at 10:41
  • 4
    @BardiHarborow What version is that? I'm on 40.0.2214.111 (64-bit) Chrome with OSX 10.7.5 and I get a scrollbar. If it's not rendering for you then that might be something to bring to the attention of the site's devs.
    – ivarni
    Commented Feb 8, 2015 at 11:49
  • "All I wanted to do was link the answer in my profile." Huh?
    – Bergi
    Commented Feb 9, 2015 at 22:35
  • @ivarni it’s a setting whether or not you want scroll bars.
    – jkd
    Commented Aug 24, 2018 at 3:23

1 Answer 1

37

It's a sandbox. Play in it.

There's no sense in yelling at people that play in it, regardless of when it was put there.

To that point, Stack Snippets don't support PHP, and the hope/intent is that you're using that particular sandbox to test Stack Snippets instead of putting just...whatever in there.

My guess is that the person felt that you were taking advantage of the sandbox with some PHP-looking code instead of actually testing the functionality, and that's a fair complaint; I wouldn't appreciate it if you threw that up there without exploring what the actual feature was. Of course, had they looked at the actual JavaScript to the right...

I wouldn't have commented in it being an old post or it being spammy; I'd probably comment to the effect of it not being clear as to what you're actually doing with it. It wouldn't make sense for me to suddenly throw some Java in a snippet to "test" it, nor would I anticipate that it would be well received, either.

13
  • I definitely agree with the last part, it would have been useful for the OP to have mentioned that they were experimenting with ways to pair PHP code with output using Stack Snippets. Commented Feb 6, 2015 at 23:02
  • 20
    I think the comment on the deleted post ("Clever...who do you want to fool with this?") makes it pretty clear that l4mpi understood what the snippet did. Commented Feb 6, 2015 at 23:05
  • 1
    This goes to show just how powerful the horizontal scroll bar is. I recall seeing an answer here on meta where someone replicated the SO login page in a snippet which could be used for bad stuff too.
    – SeinopSys
    Commented Feb 6, 2015 at 23:12
  • 1
    @DJDavid98 Perhaps this one? Commented Feb 6, 2015 at 23:19
  • @ThisSuitIsBlackNot Eeyup.
    – SeinopSys
    Commented Feb 6, 2015 at 23:20
  • Code like that used in answers on SO is just going to muddy the waters further and make certain people think that stack snippets work with PHP which there are already far to many of already. They may not have said it the right way but I'm with @l4mpi on this.
    – user692942
    Commented Feb 9, 2015 at 13:37
  • 3
    Just saw this meta question today. Here's a TL;DR of the reasoning for the comment that spawned the question: Of course it's a sandbox and OP can do whatever, but I asked myself "WTF is OP doing, who does he want to troll" and thus posted the comment (which wasn't answered). After revisiting the meta post and OPs profile today (due to a comment on the sandbox answer), I found out OP actually used the same snippet in a SO answer which I now edited out. Thus I'd say my comment was justified as this is exactly the behaviour I expected.
    – l4mpi
    Commented Feb 9, 2015 at 13:51
  • 2
    So, TL;DR of the TL;DR: it wasn't meant as "you can't play with the sandbox" but rather "don't ever do that in an actual answer"... which OP did nevertheless.
    – l4mpi
    Commented Feb 9, 2015 at 14:08
  • 3
    @l4mpi You were certainly right to edit the snippet out of the SO answer, but I wouldn't automatically assume that the OP is trolling. Except for the snippet, their answer looks perfectly legitimate; it just seems like they wanted to provide a working demo of their code. Commented Feb 9, 2015 at 17:30
  • 5
    @l4mpi: I'll add to this: if you were concerned that they'd use that in an actual answer, your response to it should have been explicit and along those lines. Leave no room for misinterpretation in your communications.
    – Makoto
    Commented Feb 9, 2015 at 17:31
  • 2
    Yeah, the comment wasn't very good. In my defense, I was just quickly browsing meta while waiting for some code to compile and the answer was just posted, thus I expected OP to still be around and reply to me. With more available time I'd have probably formulated it differently as I usually proofread and rewrite comments quite exhaustively. I guess I should stick with taking a slow approach to writing comments in the future.
    – l4mpi
    Commented Feb 9, 2015 at 19:06
  • I wasn't notified of comments after mine under this post, but now I just looked at the post where I used that snippet and saw it edited, then quickly rolled it back. After that I came to check if the same user edited it who left the comment on the sandbox a while ago to find the discussion about not to ever use that in an answer, so I rolled back to @l4mpi's edit again. I was indeed just trying to provide a working example and I wasn't aware that this kind of working example is frowned upon.
    – SeinopSys
    Commented Feb 18, 2015 at 20:09
  • @DJDavid98 well, you apparently did it in good faith (which can't always be assumed for people messing around with features like these), but at the end of the day it's still abuse of the feature. That leads to multiple problems, starting with the fact that it's now impossible to copypaste your "PHP snippet" as one would have to remove the JS part by hand. Furthermore, we already have enough users unable to understand that the snippets only support HTML/CSS/JS and attempt to use it for other languages, which then has to be edited out - your answer would only increase this confusion.
    – l4mpi
    Commented Feb 19, 2015 at 9:53

You must log in to answer this question.

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