Honestly, I don't have a strong stance on this, but here are a few points that have been banging around my head on the issue:
As Robert already mentioned in a comment, these questions seem to suggest (often incorrectly) that there is just one way to do things.
Given the above, questions like these therefore have the potential to devolve into a list of answers of the form "Your way is (correct|incorrect), (explanation)... but here's the way I like to do it..." Since this can involve opinion and personal coding preference, it could steer things in a subjective and open-ended direction.
The question can be very localized to the specific problem or code instance, making it less useful for others who come along.
It sometimes smacks of laziness. In other words, it should be easy for the poster to tell if the code functions correctly or not: run it with a number of test inputs!
All that said, I suppose certain questions like this may be useful. If the problem and the code solution are laid out clearly, and the answers keep things objective (i.e. "This solution is (provably) faster...", etc.), then other users may get some value from it. However, it seems like questions like this may be better suited for Code Review.