Answering your own question, even if you know the answer before asking, is acceptable and encouraged according to the FAQ:
It's likely that others have the question for which you have the answer but can't find it anywhere, so post away! You can even accept your own answer.
Jeff Atwood (StackExchange co-founder) wrote a blog entry about it. I get criticized for doing this - in one case by a high-rank user. Examples:
- How do I easily find IDENTITY columns in danger of overflowing? (comment flagged and removed)
- Can I write SQL using speech recognition?
Others have complained about being down-voted for doing this. I almost always solve my own programming problems, and sometimes I think the information would be useful to the community. I put effort into writing a clear, useful, well-formatted answer and it is discouraging to be accused of not following SO etiquette. I think this has the effect of limiting the content available, since people will simply choose to not post useful information to avoid the backlash.
What if a change in the UI of StackOverflow could influence user behavior? Perhaps something added to a question to clarify SO guidelines on self-answered questions? Any ideas?
How about this added to the bottom of a question that has a self-answer (I'm sure the wording would be different, but you get the idea):
This is a self-answered question, a behavior encouraged by stackoverflow. Vote on this answer as you would any other. You may offer an alternative to the original poster's answer.
Update: After flagging the comment on the IDENTITY question, it remained for at least 15 hours before it was removed. Unfortunately, this is when a question receives a lot of voting activity. During that time period, my answer received +1, and a different answer +3. Now, I'm willing to accept that the other answer is that much better than mine and select it as the solution - but I suspect some of the voting behavior was based on the comment that made it appear I was using bad etiquette.
I will continue to flag comments like this, but I don't think it is the solution to the problem. For now, I will try to cleary indicate in my question or answer what I am doing (as @MatthewRead suggested) and that it is acceptable SO behavior. I will also heed @TheGhostofChristmasPast's warning and avoid using the same block of text (in effect, a "signature") on each question.