Background
A lot of the time I will have code that is relevant towards solving a problem, but including it with my question tends to make the question look cluttered. This is really common when working with web frameworks. If I have too many pieces of code, I like to put them in code snippets for a few reasons which include
- The question looks neater
- The question looks less overwhelming and drives less potential answerers away.
- Some configuration files (e.g.
webpack.config.js
) can provide helpful information to the person answering, but really aren't the bulk of the question and shouldn't really be grabbing the attention of everyone reading the question.
Feature Requests
I think these features would help make posts look even less cluttered
1. Optional Run Code Snippet
button
Problem: These snippets always have the
Run Code Snippet
button at the bottom, but not all of them are meant to be run and running them will just produce an error(especially since the code snippets only allow certain languages)Solution: I think there should be an option to remove this button, and maybe move the
copy snippet to answer
button to smaller version in the corner(as transparent overlay perhaps?).
2. Custom dropdown text
Problem: Also these code snippets always have the words
Show Code Snippet
written beside the arrow. At least to me the blue text with the arrow beside is indicative that clicking it will drop down some content, soSolution: I think it would be better for the person posting to be able to customize the text that goes here, and then someone could change this text to something like the name of the file(e.g. webpack.config.js), or in the example below, to things like
Server.java
,Client.java
...
Example
Here is an example of a question I've asked which looks like this.