A lot. Asking a question on Stack Overflow should be the *last* step in your process for finding an answer - if the information that you need already exists, then you very much want to find it.

You want to 

- Search. Like mad.
- Formally test your code. [What is TDD?](https://en.wikipedia.org/wiki/Test-driven_development)
- Use a [Step Debugger](https://stackoverflow.com/questions/25385173/what-is-a-debugger-and-how-can-it-help-me-diagnose-problems) to Troubleshoot.
- Read current blogs. 
- Find current books. 
- Follow current tutorials. 

From [how to ask][1], emphasis mine:

> Sharing your research helps everyone. **Tell us what you found and why
> it didn’t meet your needs.** This demonstrates that you’ve taken the
> time to try to help yourself, it saves us from reiterating obvious
> answers, and above all, it helps you get a more specific and relevant
> answer!



  [1]: https://stackoverflow.com/help/how-to-ask

After you have reached the end of your rope with the pain of not having the answer, that's when you can go ahead and ask. Because at that point, you will have done whatever research necessary to make it a good question worth asking. You'll have notes you can share to help inform the folks answering as to what you need. You'll have the necessary background information to *understand* those answers when they arrive. You won't have to contend with a poorly-written duplicate of a better answer that already exists somewhere else on the site. And you won't get frustrated by having your question closed, and the folks reading it won't get frustrated by having to close it.

---

The important point remains that we absolutely want you to do your homework. Understand that our time is not free, though we do not charge for it. Answering low quality, poorly researched, or duplicated questions becomes tiresome.


---

And if the critical comment you're receiving is indeed rude - you should flag it. But you should also assume good faith, try to understand the frustration that motivated it, and strive to do better in the future. Searching and researching is a skill, mastery is achieved through practice - the abilities you gain on the road to asking questions here will serve you well long into the future.