A question is asked by a newbie that contains some code that is a long way from 'best practice' code; it'll probably work but is inefficient, maybe buggy, or isn't going to work as well as it could.
I often see these after they've been answered, and they are usually the simple questions which get very quick answers.
Is it appropriate to give an 'answer' which completely ignores the question but comments on the poster's code? See this answer How to know if a record was deleted using c# for an example.
I tend to think that if done in the correct tone then there's nothing inherently wrong (it's helpful, which is what the site is all about), but at the same the FAQ indicates that you should always give a real answer.
Read the question carefully. What, specifically, is the question asking for? Make sure your answer provides that – or a viable alternative.
There are scores of these type of helpful non-answers given every day (I'm sure I've given quite a few myself). Should they be welcomed, tolerated, voted down, or removed?