I see on other sites that run tutorials on a number of things from android, ios to web stuffs importing part or whole of code snippets from github. So does SO have such plans to avoid people linking to git repo or copy pasting code over and over again
-
11Github repo usually has lots of files and codes, importing code from github usually imports bunches of code that could break the How to create a Minimal, Complete, and Verifiable example rule. If you just need portion of code, there's no problem by copying it manually.– iv67Commented Apr 3, 2019 at 4:40
-
Related: Providing a GitHub URL in questions. The answers echo the same sentiment that Gameon67 has mentioned that it probably isn't necessary to provide any additional functionality, given that the MCVE should be easy to copy.– Davy MCommented Apr 3, 2019 at 4:43
-
2Also, I can't imagine why people would ever have to copy a segment of code more than once from Github; I would assume that the first question would solve the question with that small portion of the code, and any other question that springs up during the project would have to do with a distinct segment of code. If you believe this is an issue worth implementing a feature request for, please provide some examples of questions where this feature would have prevented copying of code multiple times like you suggest.– Davy MCommented Apr 3, 2019 at 5:42
1 Answer
It's not clear why this suggestion is beneficial for SO as it is very unlikely that code from GitHub (or any other project repositories) would be directly suitable for SO posts.
Debugging questions require a Minimal, Complete, and Verifiable Example (MCVE), which really should target a single problem at a time and hence should not be the same in multiple questions (reposting the same question does not count as valid use case). It is very unlikely one would create a project to create a MCVE of a problem; it's way more likely that enabling such feature will encourage even more code dumps in the debugging questions.
"I found this code, fix it for my purposes" questions that could really benefit from this feature are actually not encouraged on SO - making it easier to ask these type of questions is not going to align well with SO's goals.
Other types of questions would benefit from code but don't require it. So letting users dump a whole bunch of code quickly will unlikely benefit such questions too.