I couldn't find an existing question on this, the closest were to do with converting answers to comments (e.g. this).
Someone has asked a question, in which they left out a vital bit of code. Someone posted a comment asking for this code and the OP posted it as an answer when, to my understanding, it should have been edited into the original question.
How should this be handled:
Downvote, comment and move on?
Flag [as not an answer?] either instead of or in addition to (1)?
Edit the code into the question?
Supplemental: In this case the answer only contains the code requested and so could be edited-in without risk of misrepresenting the OP's meaning. If an OP responded in an answer with a mixture of code and commentary (or only commentary), how would this affect the answer? I'm guessing (3) would be less likely to be the preferred response.
Update: I did as suggested (edit-in the code, comment, flag as NaA) but the edit was rejected:
Rejected 17 mins ago:
Jibran Khan reviewed this 17 mins ago: Reject and Edit
Community♦ reviewed this 17 mins ago: Reject
This edit did not correct critical issues with the post - view the revision history to see what should have been changed.
I understand that Community
is an automated task, so presumably the "view the revision history" is a canned comment (there were no revisions when I made the edit, and the only one now is from the first reviewer which essentially puts a few words in code format
).
The question isn't the best, but nowhere as bad as many I've seen (it probably needs the OP -- rather than a 3rd party -- to improve the rest of it). But does this mean that editing-in code (that clearly shouldn't be in an answer) is futile until or unless the question is improved?
As requested: Link to question
Also: Link to suggested edit