I was browsing through some StackOverflow posts, and I noticed that often, comments had small bug fixes indirectly unrelated to the question. However, in some of these cases, the small bug that the commenter thought had nothing to do with the question turns out to be the right answer. My question is: When you have a tiny bug fix that you are not sure will fix the problem, do you put it in a comment or do you answer the question.
To the best of my knowledge, if you have a small bug fix, you should put it in the comments. I've seen too many people out irrelevant fixes in answers. If you have no way of knowing whether it's actually an answer, it's better to give it the benefit of the doubt and put it in the comments, as you won't get downvoted/flagged if its completely unrelated.
I've seen this a couple of times, and if it turns out to be the correct answer, just put it in an answer. Sometimes the asker or community will suggest this if its the correct answer.
- Don't put it as an answer if you don't know it's an answer
- If it does turn out to be an answer, you can post it as an answer.
If you notice that a comment is correct, you can reply to the comment-author and recommend that they post an answer.
If you have a tiny bug fix but are not confident that it will solve the whole problem, post it in a comment. If it turns out that it was the correct answer, you can move it to an actual answer. However, don't hold it against anybody that posts the answer before you -- you gave them a proper hint!
Sometimes I am 90% sure that my 1-liner answer is correct, but getting 100% confident may take 20 minutes which I may not have. If that's the case, I'll just slap down a comment and begone content that I may have spent 10 seconds saving somebody hours of trouble.
If you're trying to obtain more information from the asker or you're suggesting smaller fixes that you don't believe to solve the problem as a whole, leave a comment. If your minor fix or request ends up answering the asker's question then you can always form a proper answer from the comment information. I've run into this situation before over on Arqade and the community is really good about pointing out an answer in the comments and letting you know to make an answer out of it.
Only post an answer to a question if you believe what you're going to post will answer the asker's question. If you're trying to get information or you're suggesting small fixes that end up not answering the question, the community will either flag your post, downvote it, or comment to expand your answer or maybe even a combination of those things.