4

My answer to this question was extremely similar to that of another user, but his idea is more streamlined and probably deserves to be marked the answer.

That said, our code is extremely similar, and I did post first.

The differences, in short:

  • I had a little more contextual detail.
  • His/her's was shorter and a thus cleaner, but the code was improperly formatted.

I fixed the code formatting. I had not yet read this or I would have deleted my answer at this point.

Shortly, the OP asked a question about implementation in a comment on and I attempted to add the necessary details in the other user's answer. My edit was rejected, so I added the details to my answer and left a comment for the OP.

Did I do the right thing and, if not, what should I do?

3
  • 1
    Remember that your answer isn't just for the OP. Your answer explains it more thoroughly, which someone wanting to learn might be looking for down the road. Their answer is quick and to the point, which a hurried searcher might be looking for down the road. It doesn't hurt to have similar answers worded differently. That said, explaining your answer and, in your case, potential downfalls and how they may be fixed, is a great idea and you should continue to do that much.
    – Kendra
    Commented Apr 22, 2015 at 20:36
  • @Kendra Thanks for that; I will make sure to include that in the future!
    – ZX9
    Commented Apr 23, 2015 at 1:26
  • The best answers are streamlined and thorough - they lead you from a starting point to where you need to be in a concise-but-not-too-concise manner. The worst answers are neither; they waste a bunch of time telling a story about "this happened to me once.." and then just dump a bunch of code on you without explaining it. Commented Apr 23, 2015 at 6:20

2 Answers 2

4

More details usually leads to a better solution and a stronger understanding of the problem space. If you can provide an answer that explains a bit more than just code, then all the better.

Both of your answers can stand; yours just has a bit more detail to it, is all.

That said, this concerns me:

Shortly, the OP asked a question about implementation in a comment on and I attempted to add the necessary details in the other user's answer.

You probably want to avoid editing answers in that manner, as it could be construed as adding details that the OP may not have intended. In fact, if you hadn't answered at that time, I would have encouraged you to answer in a way that addressed both the original concern and the new concern (so long as it was still asking the same question in a sense), which you ultimately did:

My edit was rejected, so I added the details to my answer and left a comment for the OP.

3
  • That definitely clarifies things! So, in the future, if an OP asks for more clarification (and I didn't already have an answer), I should add my own answer with more details, even if the code is similar?
    – ZX9
    Commented Apr 23, 2015 at 1:31
  • That's not a bad approach. I wouldn't normally duplicate the code unless I could approach it from a slightly different angle, but adding more information is always a good thing to your answer.
    – Makoto
    Commented Apr 23, 2015 at 3:37
  • 2
    @ZX9 Just be careful that more clarification means more clarification, and it doesn't mean "here's a related question I had and don't feel like asking separately". In those cases it's best to just direct the OP to ask a new question and provide you the link. Commented Apr 23, 2015 at 4:26
2

I'm not claiming to be a shining example for great answers, but I often like to structure my answers to accommodate both types of "consumers". I mostly try to give a brief summary of the key points in one or two sentences at the start, and then provide more detail and background following that.

I don't think very long answers where you have to read to the end to get useful information are very friendly. Sometimes people just want a quick idea, and are perfectly fine with relatively high level and superficial information. Giving a summary at the start allows them to get what they need.

But I also strongly believe that great answers should provide some depth. They shouldn't only give the immediate solution, but also provide some explanation and background. If you can help readers understand certain concepts, it might help them solve similar problems by themselves (or even better, avoid similar problems) in the future. I think that's a much more valuable outcome than giving somebody just the solution to their problem.

That being said, if you look at answers from the very best posters on this site, they have the ability to explain concepts in a fairly concise way, while still being precise and providing a good amount of depth. While that's obviously not easy to do, I think it's a goal to strive for.

You must log in to answer this question.

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