Spare the rod and spoil the child, they say. I don't know enough about this specific subject to tell whether this comment was justified, but in general I feel that lots of questions on SO almost deserve a comment like this, and I don't have a problem with people being a bit harsh on people who refuse to read the documentation and ask silly questions to which the answer is readily available.
That said, you don't have to be harsh or rude, and if you yourself have doubts about your comment, you should certainly remove it or reword it.
Problem is that in this written communication we lack everymuch of the nuance that a one to one spoken conversation might provide, so even comments that may seem harmless to you can appear offensive to the reader. So it pays to choose your words carefully, even ifwhen you want your remark to have aan intentional sneer about the lack of research.