Strictly speaking, comments should be used to clarify, which I think happened here. But I don't see much point in discouraging people (via comments) from answering questions.
Users of Stack Overflow are free to answer any question they see fit to answer. In turn, other users are free to downvote such an answer, and/or vote to close the question, as long as such actions are not abusive. Users receiving downvotes on their answers have to decide if it's worth their while to answer such questions, or improve the quality of their answers overall.
If the OP is willing to get downvoted, closed, question-banned or suspended, they are free to continue to ask off-topic questions. But whether the OP gets an answer to their question or not is really beside the point; the ultimate goal of Stack Overflow is to preserve content that is useful to programmers.
The purpose of closing and deletion is not to prevent the OP from getting answers; it is to remove material that doesn't serve the aim of making the site a better place for programmers to find high-quality answers to their programming questions.