68

As a new Stack Overflow user, I am learning about how to use the system (reputation, etc.).

I have had many technical questions that I believe may be useful to post, but I answered them myself.

Is it acceptable to post a question you know the answer to and then answer it yourself?

10
  • 7
    I dont think you will have the chance to answer it yourself cause we are faster (you have to wait 8 hours to answer your own)
    – Fuzzyma
    Commented Apr 17, 2014 at 22:54
  • 3
    There are numerous examples of people answering there own questions immmediately after asking, so yes, you can.
    – someguy
    Commented Apr 17, 2014 at 22:54
  • 6
    Also, duplicate of Etiquette for answering your own question Commented Apr 17, 2014 at 22:54
  • 1
    I'm pretty sure that's allowed and at some point encouraged.
    – kenny
    Commented Apr 17, 2014 at 22:54
  • 14
    stackoverflow.com/help/self-answer Since it's not long enough for answer.
    – stepquick
    Commented Apr 17, 2014 at 22:54
  • 2
    Yes, you can answer your own question. I've done so several times - usually on esoteric situations with low views for which I've found a fix for later. However (IMOHO), if the point is to "answer your own question" (as in you already "know the answer"), then - don't. Go write a blog post. (There are a few exceptions with a fitting self-answer questions, but they are rare.) Commented Apr 17, 2014 at 22:57
  • meta.stackexchange.com/questions/132886/…
    – gnat
    Commented Jun 5, 2014 at 16:27
  • I'd spend some time with each question searching and making sure it's not similar to an existing question. Duplicate questions will get down-votes and get closed. Commented Nov 13, 2014 at 22:23
  • 2
    Blog post: It’s OK to Ask and Answer Your Own Questions Commented May 11, 2018 at 21:36
  • 2
    The canonical question, cross-site (if the listed 6 other questions are included): Can I answer my own questions, even if I knew the answer before asking? Commented May 11, 2018 at 21:38

4 Answers 4

62

Is it acceptable to post a question you know the answer to and then answer it yourself?

Yes, in fact, it is encouraged as pointed out in a previous comment.

The site is here so developers can share their knowledge. So, if you have spent a good amount of time on a problem and haven't found the answer on SO, then by all means please share it with the community by answering and accepting.

However, I suggest you keep in mind other rules of the site such as not posting duplicates or questions/answers that are so narrow that they will only pertain to you or any other one person. This is not a place to post a blog so make sure that the question/answer is general enough to be helpful to other members but not so broad that it doesn't target a specific programming issue.

4
  • 2
    It is encouraged, well, maybe, but if you do a small thing wrong, even if you wanted to do it with the best intention in the world of sharing knowledge, both the question and answer will get massively downvoted. So be careful... Example.
    – Basj
    Commented Jan 6, 2017 at 20:43
  • @Basj "which I removed now because it's pointless" I would say this is a big part of the reason. When doing this, the question (and answer for that matter) should follow normal guidelines. The question you have for that post, on it's own, would be massively downvoted and closed as there's no real question there with an MCVE. Had you left the question with code intact, it may have been different (as long as it was a good question)
    – codeMagic
    Commented Jan 6, 2017 at 20:48
  • @Basj and this comment probably has something to do with answer downvotes (at least before the edit)
    – codeMagic
    Commented Jan 6, 2017 at 20:49
  • 1
    I answer a lot of my own questions (stackoverflow.com/users/6500909/…) but found myself now banned from asking more questions. I started deleting unanswered questions and bingo (sarcastic) -- it looks like I am banned for ever. So be careful... I am still trying to get out of my ban years later.
    – MeSo2
    Commented Aug 8, 2022 at 17:47
21

codeMagic's answer is correct. For the sake of those who might benefit from explicit examples of what to avoid, here are some common mistakes that I've seen where people should have abstained from self-answering.

  • Self-answering a question in which the problem was a typo. This may seem obvious to many readers but every day I run into questions where the issue was a typo and the OP does not realize that their question and their self-answer are good for the trash heap. This is worthy of a vote to close.

  • Self-answering really basic questions (for instance, questions that are readily answerable by reading the fine manual). I've flagged posts by users who did this repeatedly. They looked like they got the idea that they could seed Stack Overflow with a bunch of trivial questions and answers, sit back, and reap the reputation. My flags were deemed helpful and the questions were deleted.

  • Self-answering with an answer that is a sketch of a solution (instead of a complete solution) that only demonstrates that the question did not contain the information needed to provide an answer. In this case both the question and the answer are worthy of being downvoted. The question is worthy of closure for being unclear or lacking the information necessary for diagnosis.

5
  • 4
    Do be careful of attacking asker-provided solutions. If the question really has no lasting value and it gets closed that's one thing. But there's been an unfortunate trend lately of actual solutions from the asker getting removed, then leaving a zombie question that is resolved form the point of view of the asker, but shows to (at least low-rep) others as still needing an answer. Commented May 1, 2014 at 0:06
  • 2
    Your bullet number three, "demonstrates that the question did not contain the information needed to provide an answer", is a very popular type of self-answer around here and worthy of many down-votes.
    – Sparky
    Commented May 1, 2014 at 0:45
  • I disagree with your third bullet: The realization of what was missing in the first place is an important part. The real question was: What am I missing? The answer to that is then posted. I more than once came across one of thees on my searches here and they were very useful to me. Commented Dec 3, 2014 at 17:12
  • 1
    @AngeloFuchs I can assure you that what I vote to close and downvote is useless. When someone posts a question that show a bunch of jQuery stuff, does not mention that a database is involved, and then posts an answer which is verbatim "Turns out I had a bug in an SQL query", there's nothing to save. It would be different if the OP went back to the question, edited it to turn it into something that actually shows the problematic code, and then writes an answer that explains what the problem was and how it was fixed.
    – Louis
    Commented Aug 22, 2016 at 13:21
  • @Louis Yes, the question needs cleanup after that to point out that the real question was "What am I missing". Commented Aug 23, 2016 at 8:32
5

Answering your own questions is something that's actually encouraged when you ended up solving your own problem after you posted your question.

There's even a badge you can get from answering your own questions:

enter image description here

And yes, you can also use it to ask a question you already know the answer to, just to get the question and answer out there in case they might help someone else. Just try not to exaggerate with that and flood SO with questions you're answering yourself. Also, if you intended on doing so, make sure those questions aren't duplicates of other questions and they are neither too broad nor too specific to be helpful to others.

As an alternative to posting questions you already know the answer for, you might also want to consider SO's documentation feature. If you just want to share with others how you approached a certain situation, "documenation" may be a more suitable format than SO's traditional Q&A format.

Choose wisely ;-)

2
  • 2
    As of today, documentation is shut down. meta.stackoverflow.com/questions/354217/… Commented Apr 8, 2020 at 12:43
  • 1
    Taken from the documentation link, as it will probably someday cease to work: "We have shut down Stack Overflow Documentation. Documentation was our attempt at improving existing reference materials by focusing on examples. The beta ran from July 21st, 2016 until August 8th, 2017. For more details on why we ended it, please see our post on meta. Thank you to everyone that participated. As always, the content contributed by our community is available under CC BY-SA." Commented Sep 9, 2021 at 14:03
-1

Jeff Atwood

The most classical reference I can think of is a blog post written by one of the two cofounders of Stack Overflow, Jeff Atwood, in which he states :

To be crystal clear, it is not merely OK to ask and answer your own question, it is explicitly encouraged.

Here is a Meta Stack Exchange answer by Jeff conveying the same message once more :

Absolutely, that is one of the design goals for the site: to be a frictionless technical mini-blog where you get reputation for your hard work.

Joel Spolsky

The other cofounder, Joel Spolsky, has also written a blog post on the subject :

Since Stack Overflow launched, we’ve been trying to explain that it’s not just a Q&A platform: it’s also a place where you can publish things that you’ve learned: recipes, FAQs, HOWTOs, walkthroughs, and even bits of product documentation, as long as you format it as a question and answer.

And Joel too has written a Meta Stack Exchange answer, addressing what is sometimes referred to as "trying to farm reputation" : 1

The issue of reputation, and your assumption that there is something wrong with this question because it is an attempt to "farm reputation", is insufficient proof that there is a problem with the question or the answer. Au contraire, if something earns reputation on Stack Overflow, you should assume that's because we want that thing to happen.

Former Stack Exchange staff Shog9

Self-answered questions are sometimes referred to as Q&A-style.

Here is an example of such a Q&A, on the exact topic treated here :

So we decided to bolt [the Q&A-style] right onto the Ask page.


1 I wholeheartedly recommend reading Joel's answer in its entirety.

0

You must log in to answer this question.

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