Problem: Many users post code for a MCVE that does too much.
Let's say, for example, a program reads from a file, replaces some characters with other characters, replaces some other characters, conditionally removes some lines and writes to a new file. And this program doesn't work.
Of course posting such a program would not make for a particularly good Stack Overflow question, as this program does too many things to have much future value.
Now some might say a program that does the above is a minimal example, since one may not be able to shorten the program much further while still doing all of the above things.
Solution: Explain MCVEs "do exactly one thing" (i.e. it's Minimal)
The MCVE help center page doesn't currently explain what exactly we mean by "minimal" - it's kind of left up to any given person to interpret as they wish.
As such, I propose we include a part to clarify this. For example:
Minimal
Your code should ideally do exactly one thing, with no unnecessary code.
If you have a program with many lines of code which does a few things (e.g. reading from file or command line, replacing some characters, removing some lines and writing to file), this will make it hard for people to find your problem.
You will receive better answers if you create a new program that focuses on only the one thing you're having a problem with (e.g. replace a character in a hard-coded string and just display the result on the command line).
Streamline your example in one of two ways:
...
Addendum: Improve the "Complete" part
As an addendum, I might also suggest an improvement to the "complete" part:
Complete
Post all your code and all files your code needs to run.
Include any input your code requires, whether it's input from the user or from a file (although it's best to change your program so it can run without any input).
- Some people might try to test your code and possible solutions to help them give you an answer that works.
- The problem might not be in the part you suspect it is, but another part entirely.
If a web page problem requires HTML, some JavaScript and a stylesheet, include all three.