In general when I answer a question, I try to explain my answer, which takes some time to write out. When the question is pretty simple to answer, this sometimes means that someone else will post a quick code only answer or other answer with poor explanation before I can post mine. At this point, I am never sure what to do. On one hand the answer is already posted and the general consensus seems to be avoiding duplicate answersgeneral consensus seems to be avoiding duplicate answers. On the other hand, the other answer could use improvement because it doesn't help the asker understand why the solution worked.
As I see it, there are four possible solutions
- Post my answer anyway.
- Don't post my answer at all.
- Edit the other answer to include my explanation.
- Start taking this approachthis approach and just post a quick answer, then go back and edit it to make it better.
I have problems with all of these options. If I post my same answer then it is duplicating the information and "junking up" the answer section. If I don't post, the asker (and future readers) may not understand why the code works. If I edit the other answer, I am putting words in the other person's mouth, and they might not agree with what I have said. If I post a quick answer it feels like I am just racing for rep, plus if I lose the race, I am stuck in the same position of deciding what to do with a duplicate answer.