before you click that button to report this question as a duplicate of this, consider that not only is that question 10 years old, but is also fairly non-specific, and doesn't make good use of the good subjective, bad subjective blog post in the following year. To fix a 10 year old question and expect new answers is to paint a 10 year old car and expect to sell it for MSRP.
This question is about questions that begin with "how do" or "how does", meaning questions about methodology and application. It's been a meme in most outside communities that on stack exchange the answer to the question "How do I do A" is objectively "No, don't do A, do B instead". While this may be helpful in some instances, it's at the least, very condescending.
This means this question is actually two wrapped up in eachother, and very intertwined. The first is, as above, "Is the answer "Don't do that" an acceptable response to a "how do I" question?". The second is then, following the first, "When can we assume that the person doesn't actually want to know what their question asks?" The very two are asking two parts of the same scale.
I want to throw one more subject into the ring just to make answers more concise, and cut-throat. Stack exchange isn't know for being particularly "nice". Despite the "Be nice" policy employed site wide, many users feel that they are rejected for asking questions that may be trivial to others, even if a bit ignorant. The epitome of this, in my opinion, is EE.SE, who usually refuse most (even slightly) ignorant, questions based on arbitrary guides. This has caused a huge riff in the community over the years. Going back to good subjective bad subjective, the riff appears in the professional elites, which, in a sense are the 'top 1%ers' of the site, controlling a majority of the reputation and the subjective commoners. There have been multiple people who straight up leave because the users there won't abide to said arbitrary standards, and as such the "don't so that" is said a lot there. Thus the question I want to throw in is: Does your answer support the "Be nice" policy, and will your answer have a positive effect on users if what your answer was the rule?
So let me repeat my questions: Is the answer "Don't do that" an acceptable response to a "how do I" question? When can we assume that the person doesn't actually want to know what their question asks? Does your answer support the "Be nice" policy, and will your answer have a positive effect on users if what your answer was the rule?
I encourage all to use examples of "Don't do it" answers in your answer.