20

Currently new users are led to guided mode to ask their question. Guided mode does not have an option to add a Stack Snippet. I have a feeling, at least for JavaScript/HTML/CSS questions, this leads to more questions that don't have enough code to reproduce the problem in the question itself.

Should guided mode have the option to insert a Stack Snippet?

I have a feeling there are basically two minds on snippets. One is JavaScript/HTML/CSS answerers who all lean toward snippets being close to, but not quite, mandatory. Everyone else couldn't care less about snippets.

SO say an MCVE is required for debugging help. In my experience 90% of JavaScript/HTML/CSS questioners (new to Stack Overflow) don't know how to create a MCVE or even a CVE (not minimal) so, even if they leave a JSFiddle, their question is off-topic since the code required to reproduce the issue is not in the question itself.

This is exacerbated by the fact that guided mode doesn't even give them the option to add a snippet.

guided mode

Would adding a snippet option in guided mode (maybe only if the tag includes JavaScript, HTML, or CSS?) lead to more on-topic questions?

19
  • 16
    Do new users actually know how to use snippets? Even when they get the language right, I see far too many people use snippets for code that won't run, much less demonstrate whatever problem they have with it.
    – Laurel
    Commented Jun 18, 2019 at 3:18
  • 2
    most of them know how to use jsfiddle since most of them post one, at least in the topics I watch, but end up leaving the question off topic by not knowing which part of their code is causing their issue. By suggesting a snippet at least there is a chance they'll post enough code in the question itself that it's more on topic. In other words encouraging them to use a snippet instead of jsfiddle more often then not lead to enough code in the question itself to reproduce the issue.
    – user128511
    Commented Jun 18, 2019 at 3:25
  • 3
    @Laurel I knew how to use it when I was new. We shouldn't assume new users are stupid to the point of eliminating majorly helpful post features in guided mode.
    – chevybow
    Commented Jun 18, 2019 at 16:31
  • 1
    It should at least be presented as an option so that people are aware it exists. If they don't know how to use the snippet editor it won't make a question any worse than it already is going to be.
    – Herohtar
    Commented Jun 18, 2019 at 16:37
  • If people in non-snippet runable tags are really against having code in snippets, then the snippet editor could be enabled as an option only if the OP adds a tag where it might be used. However, personally, I'd expect that having something that looks like a code editor would make it more likely for users to actually add code, which is a good thing, even if the code can't be run in a snippet. In other words, a snippet, if the code is not JavaScript/HTML/CSS, is just formatting with a convenient way to copy the code into an answer.
    – Makyen Mod
    Commented Jun 19, 2019 at 0:19
  • 1
    Does it actually hurt to have the OP use a snippet when the language is not JavaScript/HTML/CSS? I know some people don't like it, but is it that using a snippet really makes understanding the question/answering more difficult, or just offend people's sensibilities? Does it really give OP's the impression that their non-JavaScript/HTML/CSS code should be runable in the snippet? [Note: I'm not trying to be judgemental. If I was editing a non-JavaScript/HTML/CSS questions, I'd normally edit the snippet formatting out of it too.]
    – Makyen Mod
    Commented Jun 19, 2019 at 0:33
  • 1
    Also, can we fix that part about "code fences"? There's a hotkey for it, ctrl-K, and it does a way better job than three backticks (one, people screw up the extra blank line needed for things to work in the first place, and two, I saw someone use ''' just the other day). Regarding snippets, way too many people paste C# code that get inserted as HTML, JavaScript, and on at least one occasion, CSS. Commented Jun 19, 2019 at 3:06
  • 4
    I actually don't see why this "guided mode" has no editor toolbar at all. To me, that makes editing a lot easier than reading the instructions about markdown in this uncomfortable block of text that is the help dropdown.
    – Kaiido
    Commented Jun 19, 2019 at 3:16
  • @Draco18s I disagree, I find the three backticks way easier to edit. Moreover, adding the language tag makes for better highlighting - the default will sometimes highlight variables as if they are keywords. Also, having three backticks and then start their code on the next line is bad but super easy to edit - literally hit enter. I'll counter with the fact I've seen many who have merged two unrelated code blocks because you can't avoid it, or have merged a code block and actual text that is part of the question. So it's not like Ctrl+K is flawless.
    – VLAZ
    Commented Jun 19, 2019 at 6:46
  • 1
    "don't have enough code to reproduce the problem in the question itself" That would be a problem if SO was a about getting your code debugged for free. But we don't actually want debugging questions anyway, because they help only the asker.
    – Raedwald
    Commented Jun 19, 2019 at 11:55
  • @VLAZ What part of CSS syntax highlighting helps a C# code block? Commented Jun 19, 2019 at 14:28
  • @Draco18s I don't know what you mean.
    – VLAZ
    Commented Jun 19, 2019 at 14:29
  • @VLAZ If you use the snippet box and put C# code in it and tell the snippet box that your code is CSS you get a <--language: CSS--> markup tag. See this revision. This is a type of edit I have to make all the time. I'm not against the snippet window, I just...want it to allow more sensible options so that people can say "this code is Python" or "this code is Lisp" and have the language markup tag actually apply correctly. Commented Jun 19, 2019 at 14:34
  • @Draco18s what does the snippet window have to do with a triple backtick comment block?
    – VLAZ
    Commented Jun 19, 2019 at 14:35
  • 1
    @TylerH Yeah, the inaccurate syntax highlighting is certainly of concern. However that could be easily solved by allowing the user to select from a drop-down the language that they are actually entering into the editor (and disables/hides the "Run code snippet" button if not JavaScript/CSS/HTML). Overall, I think having a dedicated interface that makes it clear the user is entering code is a significant benefit.
    – Makyen Mod
    Commented Jun 20, 2019 at 19:47

1 Answer 1

1

As snippets are only for HTML javascript and CSS, a new user should learn how to use stack snippets within the question, instead of people telling them in comments. What I prefer is this

  • The wizard should detect the language using the second tab (the tag tab).
  • If the detected language is runnable on the stack snippet then the "show some code" block should mention about how to create a stack snippet and what to put inside the stack snippet. Also, a button to create a stack snippet.

By this, new users can also learn how to create stack snippets and not use snippets for Java and PHP. Which also fulfills the purpose of the guided mode.

You must log in to answer this question.