33

I asked this question on SO and someone (@sumit choudhary) put a comment that really helped me, it explained why my code wasn't working. Because nobody posted an answer, I answered my own question while giving credit to @sumit choudhary. Now, @sumit choudhary posted this comment You should put this as comment instead of answer.. I'm not sure if this is the right way. I really like SO questions that have answers and I really dislike questions that have no answers. What should I do here? Delete my answer and put it in a comment? Or just accept my own answer and ignore his comment?


Thank you all for the answers/comments. I accepted my own answer and instead of flagging @sumit choudhary's comment, I posted the link to this meta question as a comment. This link will give him more information than just flagging his comment (then he just thinks I ignored him). Next time I will ask the comment placer to post an answer.
Update: his comment is now deleted and also my link to this meta question.

3
  • 13
    You did the right thing. As much as I love comments, the appropriate format on SO is question / answer. Your answer elaborates enough on their comment to stand on its own I believe. Ignore their advice, it is wrong in this case. Commented Oct 4, 2016 at 9:01
  • 12
    Mark that comment as obsolete. Stack Overflow is a question-and-answer site, and converting a comment to an answer is perfectly acceptable.
    – Jongware
    Commented Oct 4, 2016 at 9:02
  • 3
    Related question.
    – Glorfindel
    Commented Oct 4, 2016 at 9:04

3 Answers 3

46

You could have nudged that user to re-write his comment into a proper answer.

If they don't take that opportunity it is perfectly OK and even encouraged to write an self-answer, assuming you give proper attribution, like you did. If the solution is mainly based on the work/ideas/hints of others you can make the answer community wiki. You won't get any reputation from that but you do recognize the answer is a community effort.

You can then accept your own answer.

I don't see how the answer you wrote would fit in a comment so that suggestion isn't something I would do, nor do I see any benefit in that.

26

IMHO, you did the right thing. The answer provides an actual answer to the problem, and you provide proper attribution. You can just ignore the comment and accept your own answer.

5
  • 1
    If the original comment gets removed for being obsolete (as suggested here) that would in turn make the attribution obsolete, would it not?
    – CubeJockey
    Commented Oct 4, 2016 at 15:13
  • 5
    @CubeJockey it would make it ~impossible to prove, but the attribution would still be valid. As an aside, the fact that your concern exists helps hammer in why comments are such a bad place to put key information.
    – Jeutnarg
    Commented Oct 4, 2016 at 15:56
  • 1
    @CubeJockey Yup, that is true, and there have been other meta posts where it's been agreed that attribution is not required when the original source is a comment. The attribution can/should be removed if/when the comment is removed. Commented Oct 4, 2016 at 15:56
  • 1
    @CubeJockey that referred to the comment on the answer which has now been deleted.
    – Glorfindel
    Commented Oct 4, 2016 at 16:00
  • 1
    @Glorfindel is right, I did. Still - it's a good point to mention. Comments are ephemeral, and that even includes this one.
    – Jongware
    Commented Oct 4, 2016 at 18:02
14

You were correct.

An answer is an answer is an answer. In fact, Sumit should have posted his solution as an answer in the first place. The comments section is for critiquing and requesting clarification.

There is a growing section of Stack Overflow society insisting that the comments section is also a valid place for answers. Not only is this nonsensical but, well, we can see here the confusion that ensues.

Handy guide:

  • Questions go in the question section;
  • Answers go in the answer section.

Print it out — stick it to your monitor!

2
  • 2
    "There is a growing section of Stack Overflow society insisting that the comments section is also a valid place for answers." - Well, it is if you want to help the user but haven't the time to post a proper answer. (Or if the Q has other irredeemable attributes that mean it doesn't deserve a proper answer.)
    – Stephen C
    Commented Oct 6, 2016 at 12:07
  • 1
    @StephenC: Can invite the user to a chatroom if all you want to do is "help the user", but we have broader concerns on aggregate such that if all we did was everything possible to "help the user", the site would collapse under its own weight. It was constructed, quite deliberately, to have enough structure to help in a majority of cases rather than individually! Commented Oct 6, 2016 at 12:31

You must log in to answer this question.

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