-7

I posted a question with its answer on SO and within minutes got two negative votes on the question and a comment on the answer scolding me for posting my answer at the same time as my question:

why would you ask a question an then post that code in the answer.. what is that ..is this working code or non working code..? put it as part of your initial question if this is the code that is not working

So, stackoverflow.com, please officially identify those question answer pairs as a Share Your Knowledge post so that readers understand what they are looking at. That way the question and answer pair being posted simultaneously will make sense.

My example case is here:

Dynamically read the value of configSource from connectionStrings in ASP.NET

Originally I posted merely the question and the answer. But I can see how odd that would appear to someone who did not get that you can post a Q&A to share with the community. So I looked like an ass because of that.

5
  • 7
    I've left a comment pointing out the error of his ways.
    – ChrisF Mod
    Commented Sep 24, 2014 at 16:22
  • I don't know that I wouldn't have made the same mistake myself.
    – Reid
    Commented Sep 24, 2014 at 16:27
  • 6
    But really though, maybe this wouldn't be a bad idea. Too often do users go commenting on self-answers accusing users of posting just to gain some rep without considering that they might just want to share their knowledge, and not only that, but in addition flagging such answers for our attention with the mistaken impression that you're somehow not allowed to answer your own questions.
    – BoltClock Mod
    Commented Sep 24, 2014 at 16:44
  • Related: What can be done to improve moderation of self-answered questions?
    – jscs
    Commented Sep 24, 2014 at 22:22
  • In the past, those types of questions were closed as "Not a real question". See, for example, Javascript Phone Number Format.
    – jww
    Commented Sep 25, 2014 at 0:08

2 Answers 2

19

The lesson here is that code only answers don't make good answers. You should always accompany the code with at least some basic description of what it's doing. Explain how you diagnosed the problem, the approach that the solution takes, etc.

While it's not wrong to post an answer to your own question, the quality standards are just the same as when posting any other question or answer.

This all also applies to the question; the standards for a question aren't altered at all when you answer it yourself; it will be held to the same standard as if you didn't post an answer.

8
  • 9
    +1 The gold in servy's answer is in the middle, and I feel strongly enough about it, that I'm going to repaste it, in bold: the quality standards are just the same as when posting any other question or answer. The quality of your answer is what garnered the downvotes, not the relative time that you posted the answer. Commented Sep 24, 2014 at 16:30
  • I consider an elegant answer to be of the highest quality. I don't know how an answer containing two lines of cut-and-paste code that works and can be tested in a minute would benefit from any further content or explanation that I could give.
    – Reid
    Commented Sep 24, 2014 at 16:45
  • 1
    @Reid Imagine a worst case scenario: Do you really want your credit card account number being passed around/persisted by any amount of code that was copy and pasted, without an understanding of what makes it tick? Commented Sep 24, 2014 at 16:49
  • 7
    @Reid Apparently you don't consider understanding code, why an answer works, why the problem you were having was a problem, etc. to be things worth knowing, and only care about being able to copy/paste some code to pass a test case. That's a shame.
    – Servy
    Commented Sep 24, 2014 at 16:50
  • @LynnCrumbling and Servy: I don't get your points. The code has embedded within it the information that anyone who wants to dig deeper can use to research it further. Anyway, back to work for me. Peace.
    – Reid
    Commented Sep 24, 2014 at 17:01
  • @Reid: The point is that the answer should be self-sufficient enough that the poster doesn't have to do a ton of research to figure out how the answer works. Answers here should be self-sufficient, not vague enough to require additional research to understand. If you choose to post answers that don't meet that criteria (even self-answers), be prepared to lose some reputation or get negative comments.
    – Ken White
    Commented Sep 24, 2014 at 21:44
  • @KenWhite I would like a single SO user who has a background in C# and ASP.NET to say that he or she needs any additional information to understand the answer I posted. I don't think such a person exists.
    – Reid
    Commented Sep 25, 2014 at 4:24
  • @Reid: But the point is to provide an answer for those who do not yet have a background in C# and ASP.NET so they can use the information to develop that background. It appears you've not yet learned the goal of SO (and SE in general): It's not to solve a single person's immediate problem, but to build a knowledge base for the benefit of future users, and those people may not have the background yet.
    – Ken White
    Commented Sep 25, 2014 at 12:14
2

I haven't looked at your specific answer.

In general though I do notice that self answered questions are often accompanied by comments from people clearly unaware of the concept.

So on the general issue some kind of (possibly temporary) "instant self answer" indication that links to explanatory documentation might be a useful way of educating such site users.

A couple of other instances of this I saw at the weekend are One, Two. Though the comments are now cleaned up on the second one.

Perhaps someone with DB access, who can see deleted comments, could spot check a random sample of these questions to discover how prevalent the issue is.

1
  • 2
    sigh reopened that one.
    – BoltClock Mod
    Commented Sep 25, 2014 at 17:03

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