I was wondering if users would be penalised in any way for posting examples instead of questions?

Is this site for questions only?

  • 5
    If you think you have examples that could help people and answer questions that haven't been asked, you could ask a question, and then post your own answer.
    – Yahel
    Jan 9, 2011 at 2:37
  • 2
    It took me a minute to understand this, but I think you're asking if it's ok to ask a question you think others may have, and include the answer in the question itself. This is part of the FAQ already: Can I answer my own questions, even if I knew the answer before asking? Jan 9, 2011 at 8:52

3 Answers 3


No, your actual question must be a question, and your answers should address the issues raised in the question. You should not intentionally answer your question in the question body. However, you are totally free to answer your own question.

This isn't as restrictive as it sounds. If your example solves a reasonable problem, post a question asking for an answer to the problem and post your answer. Just do a check to see if it’s a duplicate.

If you want feedback on your example, figure out some specific questions to post with the code and ask away.

And if you have any future questions about the validity of a question or anything else about Stack Overflow, meta is free for you to ask away. :D

  • Thank you! I just did exactly that! I posted a question, but included my own solution inside the question ;)
    – techexpert
    Jan 9, 2011 at 2:55
  • 3
    Please do not post the solution inside the question body. Instead, post it as an answer to the question. Dec 6, 2022 at 16:09

If you think you just want to post a solution to some problem you came up with and will be helpful to others, I would suggest you to write a blog article about it, describing about the issue and solutions. If you don't have or want to have a personal blog, there are free sites where you can post your code/article.

And if anyone has that problem in the future, your blog/article will show up in the web search. I don't see a reason to posting it on Stack Overflow.

Usually it should be like: You have an issue/question → ask on Stack Overflow → After getting/gathering an appropriate answer /solution (that includes the solution you found after posting the question) → blog about the issue in detail and the solution to it, pros/cons, and point Stack Overflow as a reference, giving credits to the persons involved.

In short:

1: I wouldn't recommend just posting a self question/answer post. You can get downvotes if you do that. Instead blog it somewhere.

2: In the future if you have a question about Stack Overflow itself you ask it on META and not Stack Overflow.

  • Thank you! I didn't know about the META. Next time I would definitely ask there. But I see no reason to not want to post a question and offer my solution as a part of the question on StockOverflow and let other people offer their solution as well. Because a lot of people are using the site's search engine (and Google too) to see if anyone already has a ready-to-go question/answer before they would post their own. I also think that this site is much more effective than most blogs I came across. But, again, thank you for the META reference. I gave you an "Up" vote just for that! Peace!
    – techexpert
    Jan 9, 2011 at 3:13

This site is for questions only. You will get downvotes if you post examples.

And why would you want to post examples?

  • Because I think I might have a solution that would be beneficial to other people when they're doing a search, whether on this site, or in Google.
    – techexpert
    Jan 9, 2011 at 2:41

Not the answer you're looking for? Browse other questions tagged .