Often you have a question, you can't find the answer on Stack Overflow so you search for it (or think a bit more). Having found the answer you'd like to keep a record so you can find it again later.

Before Stack Overflow I would write a blog post so I could search for it later. Jeff and Joel, I think, specifically said SO is a good place to replace these blog posts. So what is the best etiquette for adding your answer?

  1. Just ask the question, then post your answer immediately and let voting sort the answers out. This is okay, but it looks like you are just trying to generate reputation, and other people often don't vote or answer, and a lot of the SO information is lost.

  2. Provide the answer in the question and ask the question phrased as "is there a better answer". This allows others to gain reputation, and doesn't look so greedy but makes your answer harder to vote on.

  3. Post your question, let others answer it. If no-one puts the answer you already found, then add it an hour or so later. If someone else gets it then accept their answer (or the best one). This is more selfless with reputation, but makes other people do work you have already done which feels a bit lazy and a waste of everyone's time.

Or maybe there is another way?

Return to FAQ index

  • 17
    By the way, in a nice bit of self-reference I used option 2 in this question and it seems to be working ok :-)
    – Nick Fortescue
    Jan 30, 2009 at 9:33
  • 10
    Note (now nearly 2 years later) that including the answer in the question is not currently accepted as a good idea.
    – Gnome
    Nov 1, 2010 at 12:50
  • 3
    A good question followed by a good answer is useful to everyone, it doesn't matter who the author is. Any idea that this should be frowned upon is antithetical to the function of a QA site. These questions and answers don't exist for the answerers, or even the original askers (although they benefit), but for the subsequent readers. That's why questions aren't deleted when they've been answered to the asker's satisfaction. Apr 21, 2017 at 16:55
  • 1
    In case of using option 2 it could happen that someone runs into a primarely opinion based or a we are not code-review issue, since asking "is there a better answer/way" is going a bit into that direction..
    – iLuvLogix
    Apr 9, 2019 at 14:07

5 Answers 5


Just post your answer immediately after you post the question. Like you say, phrase it as a request for comments to improve your solution. Your intentions are clear --- I wouldn't think you were trying to generate reputation. Besides, it's my prerogative to reward or punish your efforts. Alternatively, you could mark your answer as a community wiki if you are feeling charitable.

You can now do this automatically by ticking the “Answer your own question” checkbox when posting the question, provided you have more than 15 reputation.

  • 2
    For some reason, this doesn't seem to work quite right. I posted a question together with an answer which wasn't the best solution but it worked. I attracted some votes for close and lots of people rushing in to answer without even reading the question properly. Any idea how to avoid this? Here's the question, as a reference: stackoverflow.com/questions/18762588/… Sep 12, 2013 at 11:59
  • @MihaiTodor That linked question had gained 7 votes and 5,965 views as of my last visit. Sounds like an 'ok' question to me. || "X... doesn't seem to work quite right" is almost always happen, IMHO, in every step of "educating" the audience to a guided system or new principle.. || I look up on your stand coz you had actually 'published' the QnA site of your own before.. I'm just as curios to see.. how the highly flexible 'freedom to answer/comment/edit' power (in SE) vs freedom to 'comment' (in blog) compares.. It's an interesting study on it's own..
    – p._phidot_
    May 10, 2019 at 0:46
  • @p._phidot_ I don't really have an answer for that, sorry. Good luck with the study! May 10, 2019 at 22:34
  • 1
    @MihaiTodor Thanks for the support.. really appreciate it.. Hope these kind of organizational behaviour study can help us leave more deeds than just 'data' when we left this world.. | Really appreciate it.. /(^_^)
    – p._phidot_
    May 11, 2019 at 20:20

The community benefits from having a growing store of useful question/answer articles on this site. This is true regardless of whether the question and answer are provided by two different people or the same person. Also, a person who writes a clear, easy to find question and then an easy to follow answer has done some unpaid work to help other people, so they deserve reputation points as much as anyone does.

This is presumably why the FAQ says:

It's also perfectly fine to ask and answer your own programming question

The aim of the site is gather lots of useful questions and answers. It does this by rewarding those who take the time to contribute with a simple points system with a scoreboard, the points being rewarded by the other users.

If the users habitually award points based on anything apart from the usefulness of the questions and answers, the site will end up as a respository of... what? Depends what weird criteria people are using to award points.

It can be difficult to keep that in mind, as we are not totally rational animals, and all incentive systems produce a certain amount of irrational complaint as a by-product, but it's worth a try.

Maybe one day, when SO has taken over the world, and is the Walmart of programming tips, someone will start a 100% "organic" programming Q&A site, where all the questions and answers are certified to be based on genuine incidents involving exactly one programmer lost in a puzzle they can't answer and one or more enlightened heroes who come to their rescue. And maybe it will feel better that way!


I got marked down and slated for answering my own question.... If you look at the badges there is one awarded for answering your own question and getting > 4 votes. This means this is surely approved, and what's more the only method where you will get a badge for it!

  • What? I don't see that badge. May 14, 2012 at 10:26
  • 2
    @jmendeth Self Learner
    – Ben Brocka
    Jun 22, 2012 at 21:14
  • 10
    Yes, I too ruffled some feathers after posting this Q and A. First and foremost, I think of SO as a vast knowledge base for programmers. I value SO for the answers it yields far more than the reputation I have earned. But my sense is that many feel that the primary purpose of SO (and the other StackExchange sites) is that as a forum for competition.
    – DavidRR
    Dec 20, 2013 at 14:46
  • Well it makes sense that you ask a question.... then when non one answers, you find your own answer to the question as yr the one that needs it after all.. May 8 at 12:03

I think #2 is a strong answer, respectful of the SO community.

Asking a question you know the answer to (especially if you answer int he same breath) is of dubious value and intent, but if you approach this with the mindset that what you think you "know" might not really be the best answer, I think you'll be illuminated most of the time.

Nine times out of ten when I go to answer a post, I'm still going to see something which augments, challenges (and therefore causes me to research and reinforce or change my opinion), or completely surprises me. You don't knwo what you don't know after all, and us programmers do tend to lack a certain humility. :P

  • 17
    #2 is a bad idea. What if the asker's answer is a good answer? Then we end up with an answer in the question, and no answer as an answer. It completely abuses the format of Stack Exchange. Jun 23, 2012 at 23:42

According to this link on Stack Overflow, it would follow that #1 would be the right etiquette.


As mentioned above by @Zach Scrivena, there is even functionality to submit the answer at the same time.

To address the etiquette (as in the title of the question), given that answering your own question is "explicity encouraged" by Stack Exchange...

Yes! Stack Exchange has always explicitly encouraged users to answer their own questions. If you have a question that you already know the answer to, and you would like to document that knowledge in public so that others (including yourself) can find it later, it's perfectly okay to ask and answer your own question on a Stack Exchange site.

...the question of etiquette might be redirected to the users reading the self-answered question. If you are down-voted, slated or given abuse by users BECAUSE you answered your own question, I believe you should have the right to report that user or flag the behaviour (not sure of the protocol/lingo as I have never reported anyone).

  • 1
    Re "If you are down-voted": That information is only available to developers at Stack Overflow (and similar) with direct access to the database. A time correlation is not sufficient evidence. Oct 12, 2022 at 14:23

You must log in to answer this question.

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