This question is inspired by comments on a question on Stack Overflow. The original poster wrote:
How to correct this error?
And comments say that it's an incorrect question. Better is
How do I correct this error?
I am not a native English speaker, so the fact that both versions sound natural to me is quite irrelevant. But I would like to ask anyway whether the first version is really bad.
I have seen a lot of questions starting with How to, so if you say that the first version is incorrect, could you please summarize when it is OK to use How to and when it is preferable to say How do I.