Say I've posted a question about something I consider more a general pattern than a specific problem, and that question already has an answer that sketches a solution idea. Based on where the problem originated from and the comments to the question I'd now like to add a more elaborate answer.

However, I'm a bit unsure what is the best way to do that. There are three ways I can see:

• Modify the question, add all the explanation there, and accept the given answer;
• modify the given answer and accept it; or

Especially in the last case the problem is whether to accept the given answer (more polite) or to accept the new one (because it's "better").

What is the preferred way to deal with this problem?

I don't know the details of the specific case you have in mind, but there are a few general principles that can guide you.

## Do not edit your question in a way that invalidates existing answers

Of course there are many edge cases here. What if you haven't gotten an answer yet? What if the original question was ambiguous or did not contain enough details? What if there was a genuine misunderstanding between question and answer? You will have to use your judgment to decide whether to edit your question in that case or to ask a new question. But I would urge you to err on the side of asking a question too much rather than invalidating existing answers.

## Try to refrain from editing other people's answers significantly

I say 'try to' and not 'do not' because editing is an essential part of the stack exchange system. Editing typos, adding links, formatting etc. is obviously OK, but putting words or code in other people's mouths is a more delicate matter. After all, their name is still attached to the post and they will get notifications about it (not the editor).

I have on a few occasions edited other people's answers significantly (mostly to make sure the code works with newer versions of biblatex). But usually I only do that after leaving a comment asking for the change is gone unnoticed for a long time, or if the user has not been seen for long time. I also try to keep the changes as small as possible and only modernise the code as far as necessary.