22

Per this SO Blog post, I've been working for about 2 weeks on trying to get Ajax uploading of files to work in Rails 3 using Paperclip to manage attachments.

I finally found a solution that works really well, and is much better than any of the tips I got in several questions that I asked. In the spirit of sharing the final answer to all the questions I was asking I wanted to type up a "canonical answer" that would really explain how I finally got this working, with hopes that it will help many others.

There are dozens of questions on this topic, many of which have been answered already. It seems silly to "ask it again" just so I can post my own answer to my own question...

So, what I'm wondering is, if you've come up with a really good solution to a commonly asked question, what's the best way to share it with the SO community?

3
  • Hmm, now we have the EXACT two competing answers that I'm torn between. Somehow asking a question just so I can answer it seems arrogant, but it's also an easier way to make sure I'm setting up the answer with the most general form of the question. So, which of these two options do you all feel is more appropriate / less rude? Please vote!
    – Andrew
    Commented Jan 16, 2011 at 20:11
  • I'd really like to see some debate and discussion about this since all I have right now is two opposing answers. I've offered the biggest bounty I can afford :)
    – Andrew
    Commented Jan 18, 2011 at 18:00
  • It's ok to ask a question and answer it on SO, just make it a good question and a good answer. Commented Jan 23, 2011 at 23:10

5 Answers 5

15
+100

Canonical answers only make sense if they're answering canonical questions. Posting your great and detailed answer to some highly-localized version of a massively-duplicated question does not help very many people because most of them are never going to find it.

That doesn't mean you must create your own question, however. If you read Joel's post from top to bottom, you'll see that an important element of that is editing other people's questions. In particular, if you see a question that's almost canonical in nature and is reasonably well-written to begin with, then edit it. Give that person credit for being first, but help the community at large by editing it into a form that will have greater impact.

Don't worry about upsetting somebody with your edit. Be bold. Every action here can be undone if something goes wrong.

There are of course going to be two notable cases where you can't edit an existing question, and those are (a) when all of the existing questions are terrible (cf. NullReferenceException), or (b) when you don't have the reputation to edit.

If either of those two exceptions describe your situation, then start your own question, and leave a comment about what you're trying to accomplish. Don't worry that you're answering your own question. Don't even worry that you're creating a question just to answer it. That's expected. That is what the Self-Learner Badge is for. It's even right there in the FAQ:

It’s also perfectly fine to ask and answer your own question, as long as you pretend you’re on Jeopardy: phrase it in the form of a question.

That's it. As long as your question is a question, it doesn't matter who answers it or when. What matters is that the question can be found, and that it has a good answer. That helps everybody.

The notion that self-answering should be discouraged in any form is wrong-headed; as long as people are following the rules and posting good content, we want them to continue. You're not being arrogant, you're being practical.

One last thing: If you decide to start your own question because all of the existing ones are too lousy to be salvageable, and you happen to have 3000 rep or more, then start your canonical question and start voting to close all those others as dupes. Yes, seriously, do it. We might want to keep all the dupes around to improve SEO but that doesn't mean we want people posting new answers to them if there's already a perfectly good canonical answer (and question).

1
  • Closing all other questions as dups is the good. If eventually, others aren't closed for any reason, I guess I would at least post a comment under other questions pointing a link to the generic answer I just wrote, be it under a new question or under some (modified) old quesiton. Commented May 20, 2015 at 0:24
10

Ask a question yourself and then answer it.

1
  • 8
    @Good, NO, that's the way we do it on Stack Overflow. As long as the question isn't a duplicate, you're welcome to post a good question and answer it if there is no existing question that needs that answer. Commented Jan 23, 2011 at 23:08
8

Answer an existing question. This is why we have revival and necromancer badges.

As to which question to answer: try to find the most general question that your answer applies to.

5

I think the answer is both -- try to find a question that your answer would reasonably fit, but if you can't, there's no harm in asking a question to answer it yourself.

I think it's important to try to find an existing question first, since SO isn't a blogging platform and we don't necessarily want to encourage people using it as such by posting questions with the sole purpose of answering them right away, but if no existing question really fits and the answer is on-topic then it's fair game to open a new one.

From your post I get the impression that there are multiple existing questions that your answer would fit, so pick one of them, answer it, and if you're feeling industrious go through a few of the other ones and add a link to your answer in the comments.

Alternatively, you could always wait until someone else asks the question and post your answer there. That'd potentially be a long wait, though, depending on how common or widespread the issue is.

1
  • If there are plenty of similar questions, I guess wouldn't be the one to ask one more anew unless I have the answer well prepared, as in the situation of OP. Commented May 20, 2015 at 0:19
2

Anna touched on this in her answer, but do you have to limit yourself to the confines of SO? If you've written and compiled an answer that transcends a set of questions, why not write a blog post and either host it yourself, or submit it to whatever popular blogs are for the relevant topic and have it posted there?

1
  • 2
    I've thought about that, and probably will make a page for it on my server, but I also want to put it where people will actually find it... that means Stack Overflow. Thanks for the suggestion though!
    – Andrew
    Commented Jan 19, 2011 at 1:03

You must log in to answer this question.

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