It's worth remembering that the people answering questions here are mostly doing it for fun. I personally like to have questions that invite a variety of approaches: it gets a bit boring noting yet again that the posted code has no documentation or test cases.
So if you hedge the site about with rules that overly restrict the kinds of questions that can be asked and the kinds of answers that can be given, you risk making it less interesting to visit.
The linked question isn't all that great, but there are plenty of decent "improve this code" questions. For example, I thought this onethis one was quite good.