607

I often see posts in which no Answer has been offered as such, but the user's problem was solved using advice which appears in the comment section (or in extreme cases in the extended discussion in chat) of the post.

This is mildly upsetting, because there's nothing at the scrolling-list level to indicate the post has a successful resolution. So it reflects badly on the stats (unanswered questions), and future users are likely to click elsewhere when the answer is available there.

The obvious (impossible) solution is to contact the advice-giver and make them present the helpful advice as an official answer. And then, of course, go ride after the user who posted and tell them to go accept it.

More than once I've posted an answer, made obsequious motions of gratitude to the actual answers -- "See the comment! Please return, T-Pony, and get the credit you deserve!" -- and of course kept the secret hope that maybe I'll scrounge an upvote (or two) by accident.

What's supposed to happen? And how can I Keep My Motives Pure?

0

7 Answers 7

483

Post your own answer describing the solution.

If you are taking an answer directly from one or more comments, you should give credit to the authors of those comments. Something as simple as:

As Smandoli suggested in a comment

is all you need. Tip: you can obtain the link to a comment by clicking on its timestamp.

You may, optionally, choose to mark the answer as Community Wiki by checking the "Community Wiki" box at the lower right-hand corner of the edit/compose area. The purpose of Community Wiki in this case would be to mark the answer as not being your own, original work, but rather a collaborative effort. While not strictly necessary, many users feel that it is good practice to mark such answers as Community Wiki. (If you're adding a lot of original content to the answer, even though you got the original idea from a comment, you should almost certainly not mark the answer as Community Wiki, as it does represent a substantial contribution of your own work.)

10
  • 2
    Example: stackoverflow.com/questions/20796943/… Another example where I posted an answer which was incorrectly suggested as a suggested edit: stackoverflow.com/questions/4954876/… Commented Apr 22, 2014 at 1:06
  • 11
    This is the ultimate solution, but if the question is relatively recent you should probably follow pennstatephil's answer and leave a @ comment with a reminder to re-write the final solution as an answer, so the correct person has a chance to get the credit. I often leave comments with suggested solutions because the question wasn't clear and I don't feel like writing up a full answer until I'm sure that I'm solving the right problem. (And sometimes the final solution is more worthy of a "close as trivial" vote than a full answer, as Jonathan Leffler notes in comments above.)
    – AmeliaBR
    Commented Apr 26, 2014 at 0:10
  • 21
    This community wiki box is a highly underpublicized feature. (Well, maybe I'm saying that because I didn't know about it, and the universe revolves around me.) Either way it is the solution to one of my SO pet peeves: answers in comments. I just used it here for the first time. Yay! Commented Apr 28, 2014 at 8:00
  • 3
    I just tried to do that here: stackoverflow.com/questions/12585612/… and got a "Trivial answer converted to comment" message.
    – aronisstav
    Commented May 13, 2014 at 12:21
  • 3
    What about the existing comment? Should it be flagged as not constructive / too chatty / something else? IMO it's just duplicate information. A recent example here where the comment has the same information as the answer
    – default
    Commented Apr 20, 2015 at 10:09
  • 1
    Does this still apply if it is your own question with no answer? I had my question answered in the comments, should I answer it myself, or answer it and convert to a wiki? Example Commented Jul 8, 2016 at 7:46
  • 3
    That would work, but is a waste of someone's time. Wouldn't it be better to flag the answer in the comments and for the culprit to receive a penalty? Answering questions in comments almost guarantees that the question will remain unanswered.
    – under
    Commented Nov 14, 2016 at 22:45
  • some of the senior (3k+ rep) really like doing that (ans in comment).. "-_- | "Wouldn't it be better to flag the answer in the comments " <--- ya.. y not? SE management principally not allowing it?
    – p._phidot_
    Commented Jan 20, 2022 at 19:27
  • 1
    Post the answer as answer 👍, make it community wiki 👎 Why would you do that? You had the work to move it there, something the original commenter should have done, so why shouldn't you get the praise?
    – Mecki
    Commented Jan 27, 2022 at 22:20
  • You can obtain the link to a comment by right-clicking on its timestamp
    – Julien
    Commented Jul 3, 2022 at 13:23
322

I've wished on a few occasions to be able to provide an answer "on behalf" of 'user_X' based on their comment to the question that was the correct solution. I don't want the credit, I just want to ensure that there is an answer that I can vote on (without stealing credit from 'user_X') and to also be nice and ensure that 'bad_boy_Y' doesn't come along and spot the obvious answer, provide it word for word, and take all the reputation credit.

An option for a ~20k+ user to convert a comment into an answer (ownership maintained) would be really cool... especially if the original comment converted to say...

This comment has been converted into this answer (that would actually jump to the answer)

As it would be really nice if the person that did the sleuthing work to solve the problem in the comments got the credit for the answer.

14
  • 152
    can you convert this answer to a feature request? I'd vote for it :)
    – eis
    Commented Apr 22, 2014 at 14:15
  • 2
    That would be a nice addition, but it would probably be too much work for the people who maintain the site, for too small a benefit. At least this way, you're providing credit to the comment-giver, and if he/she decides to answer, you can take down your answer (if you're strong enough to resist the temptation of more rep).
    – trysis
    Commented Apr 22, 2014 at 14:23
  • 11
    bad_boy_Y feels this doesn't really count as an answer.
    – Smandoli
    Commented Apr 22, 2014 at 17:20
  • 24
    The idea of converting comments to answers is nice is principle, but I'm not sure how often it would be practical. Generally I find that when questions end up answered in comments it is a series of comments and back-and-forth with the OP, rather than one single comment that solves it all.
    – AmeliaBR
    Commented Apr 26, 2014 at 0:01
  • 4
    This opportunity should also be given to the person asking the question. Commented Oct 13, 2014 at 15:20
  • @scunliffe: see AT eis request. would you do it or not?
    – serv-inc
    Commented May 3, 2015 at 8:43
  • @user1587329 I certainly can... I'm just not sure if it would be "worthy" enough to be considered.
    – scunliffe
    Commented May 4, 2015 at 13:14
  • 7
    If user_X is silly enough to write the answer in the comments or too lazy to write a full answer, I say let bad_boy_Y go for it. The end result is that googler_Z gets their problem solved.
    – Suragch
    Commented Jun 18, 2015 at 11:22
  • 4
    @Suragch in certain cases yes... but if the comments went back and forth to get to the root of an issue, then I feel the commenter that tried to help, dug into the issue, and worked out a solution deserves some credit.
    – scunliffe
    Commented Jun 18, 2015 at 14:33
  • 5
    Generally the person posting answers as a comment have strong reasons to do so; e.g. not being able to spend enough time writing a full fledged one, not being 100% certain etc. Converting them to answers could annoy (often high rep) users and if it is done, it should be done with utmost care. Maybe provide feedback to said user with an [edit] / [commons wiki] / [revert] set of buttons? Commented Feb 20, 2017 at 22:20
  • 2
    Yes we need this! Super hard to find things that aren't answered yt because of this!
    – Mark Deven
    Commented Jan 12, 2018 at 19:56
  • @SamuelÅslund that option was already willingly forfeit by the comment poster when the answer in placed the comment.
    – p._phidot_
    Commented Aug 8, 2021 at 21:12
  • @MaartenBodewes I get it if this is a forum/reddit. But if stackexchange sites.. its quality control / culture encourages answers to be placed only in answers box (to take remove this question from answers:0 search) | While this action is format-point-view correct. It does not allow a short answer to be post as answer ( I mean, real answer. Not just link ) I have trouble to make a short &concise answer (needlessly) long &no-added-value/info... '-_-
    – p._phidot_
    Commented Aug 8, 2021 at 21:30
  • 1
    I occasionally provide an answer in a comment where I am pretty sure it is a duplicate. But I search for enough duplicates already and I am not going to do it each time it seems likely. Obviously, in this case it shouldn't be converted to an answer.
    – Mark
    Commented Mar 17, 2022 at 22:39
60

I generally ask the commenter (using an @ callout) to convert it to an answer so I can accept it. The feature proposed by scunliffe would be a nice way to do that work for them.

5
  • 1
    +1 ...I started using callouts only recently and needed this answer to get my awareness up on how to apply here.
    – Smandoli
    Commented Apr 24, 2014 at 15:34
  • 1
    I do it stackoverflow.com/questions/28755224/… is the better for me
    – jasilva
    Commented Mar 24, 2015 at 18:53
  • 4
    Good idea but it doesn't work in practice (I found out). Commented Feb 20, 2017 at 22:18
  • This would seem like it would work, but practically, it doesn't seem to work, nor does it usually work. Commented Nov 12, 2020 at 21:17
  • What is @ callout person doesn't do it? which happens a lot. We have a data quality problem with this. Questions answered in the comments, but not labeled as answered. It affects when a user searches for non answered questions and found questions that were really answered in the comment section.
    – David Leal
    Commented Apr 22, 2022 at 23:25
41

Answer your own question but give credit to the person/s that left the comments, I have done that in the past when I received the answer I needed from two different people in the comments, I just answered my own question, copied the answer from the comment and gave credit to the people who posted the comment.

3
  • 5
    Agreed. But I was interested in dealing with posts by others.
    – Smandoli
    Commented Apr 22, 2014 at 17:16
  • Yeah I think the response by @scunliffe was the best but until they implement such a feature (if they do) then I think this may be the best way to do it.
    – TristanD27
    Commented Apr 23, 2014 at 8:50
  • 1
    @Smandoli It should apply also to question of other users. You could just answer the question but give credits to the commenter. Making the answer a community wiki and giving credits to the original commenter sounds maybe like the best option. Commented Apr 28, 2014 at 7:46
30

If you think that you know the answer then post it. If its essential part is written in an existing comment then provide a link to it in your answer. That's it.

Note: don't make it a community wiki unless you want to avoid the responsibility if you posted a wrong answer: the original comment may point in the wrong direction and/or you may interpret it wrong.

29

A comment that answers a question usually contains the key parts of an answer, but there's almost always additional detail that could be included. Go ahead and answer the question, but make sure you take the time to do a thorough answer. This of course assumes that the person who wrote the comment has had sufficient time to decide whether they want to answer it (Give them at least a few hours).

That way you are really contributing to future seekers of the question, and not just copying someone else's answer.

2
  • Usually when I find it, the Asker has already validated the comment/answer, and there is nothing to add. In any case bad_boy_y has difficulty regarding this Answer as an actual answer.
    – Smandoli
    Commented Apr 24, 2014 at 16:32
  • 2
    I would go this route, assuming there's real value add in giving an answer at all. Anything small enough to fit in a comment can probably be expanded upon to make a much more useful answer. Just make sure you give credit, with something like "Expanding on a comment from Bob (<insert bobs commenr=t here>), blah blah blah".
    – paxdiablo
    Commented Nov 15, 2015 at 14:24
7

Answers are for (valid) questions, comments are for commentary

First, carefully consider whether the question meets the site's standards, and whether the comment actually constitutes an answer.

Sometimes, people use comments instead of writing a proper answer because they don't think it's appropriate to write a proper answer. There are a variety of possible reasons for this, some better than others. Keep in mind that any upvoted answer will prevent a closed question from being automatically deleted, indefinitely.

  • If the problem in the question is caused by a typo, politely pointing out the typo in the comments is more likely to leave a positive impression of the site than a silent closure. Either way the question should not be given an answer, but why not take a moment to be helpful?

  • Similar reasoning applies if the problem is a result of failing to apply logical reasoning to what the asker already knows. Before posting a question, everyone is expected to look for solutions, attempt to debug code to isolate the problem, try to create a minimal reproducible example when debugging, analyze complex problems to find a specific sticking point, figure out clear and unambiguous specifications for the how-to questions, consider corner cases, etc. etc. When this has not been done, generally the result is a question that either "was resolved in a way that is unlikely to help others", or needs debugging details. In other words, a question that should be closed.

  • If the question is asking about a complex task that has an obvious and natural sequence of steps to follow (in particular, if it is a homework assignment with an explicit bullet-point list of tasks), someone might comment to explain what those steps are. This doesn't really answer the question (there probably isn't enough detail on each step, within 600 characters), and the question shouldn't be answered (since "needs more focus" is an explicit reason for closure).

  • On the other hand, sometimes comments are used because the commenter thinks the answer is trivial. This does not invalidate questions. We don't care about the difficulty of questions, or the simplicity of their solutions, and nominally we don't even care if the documentation includes an up-front tutorial that directly gives the answer. The purpose of the site is to function as a repository of information, in Q&A format. This is, to my understanding, what's meant by "every question about programming" in the tour.

If there's a valid question and you know how to answer it, you should answer it - regardless of how you know how to answer it. If your answer comes entirely from a comment, give credit properly, and format the comment's information properly as an answer. If your answer is inspired or informed by someone else's comment, give credit by quoting the comment in your answer, and crediting the author. In either case, please then flag the comment as "no longer needed", as it has served its purpose. Comments are not intended to be long-lasting on Stack Overflow, as this is not a discussion forum.

If there is comment discussion that doesn't answer the question, but prompted an understanding of the question that makes it answerable, then write your answer, and if necessary, edit the question (or propose an edit) so that it reflects the understanding that was gained from that comment exchange.

You must log in to answer this question.

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