TL;DR No, I would not make this a requirement.
For the actual why for this no, there's a quite simple reason: In lots of cases people don't know why there code is not working, hence they ask the question. That means: Commenting, asking questions, editing the question, editing answers, rinse … repeat.
Forcing working code examples could be something that we need for answers, as there is too often some very broad and general answer that could easily be written out in code – for what some people are just too lazy. The downside of this – and this is why I would vote no for that one as well – is that this would encourage a lot of people again to outsource their work to this site, a situation that we had for a long time with some users. It would also narrow down the answer to one single problem and de-generalize some answers which would maybe even make it less helpful for later readers. Remember that we discourage adding code without explanation already.
The rule of thumb for a good question is:
- Explain your problem, your expectation and the the outcome, the best you can
- Show what you have tried
- Outline where you are stuck, add proper debugging, error messages, broken parts
- Edit the question and show your progress
The rule of thumb for a good answer is:
- Explain where you see or expect the problem to be
- Outline how to solve it
- Show how you go down the rabbit hole
- Write it as general as possible to catch as many related use cases as possible
Nowhere in both scenarios I can see code an absolute necessity.
Also, as this site is not only about application development, but about site and server administration as well, I have a hard time to imagine how people would show a minimal working code examples for problems with for e.g. WordPress install with a Redis Drop-in, powering cache behind an nginx reverse proxy that responds slowly for one of three Lighttpd upstream servers, but works well in a local VVV-Vagrant development setup.