10

Just to be clear I have no problem with this particular case at all (if anything it may gain my answer more upvotes), but in this question, the original poster edited my answer to include the code they ended up using whereas my original answer only spoke in general terms without any code sample (other than the linked sample in the source documentation).

Is this the most appropriate way to do this, or should the original poster:

  1. Edit their question to include the code sample
  2. Add another answer to include the code sample
  3. Other?

I have done both 1 and 2 myself but was just wanting to hear any thoughts on what seems most appropriate.

Personally I feel that they should get credit for their contribution, which they will not get if they edit someone else's answer. I suppose in other cases, if the code doesn't work (or worse), then the edited answer may even get downvoted.

I would lean towards 2.) because that lets the solution be rated based on its own merit, not that of the original question.

2 Answers 2

9
2.Add another answer to include the code sample
3.And..accept the answer which guided to the solution :)
3

The answer should be written as an answer imho. So 1. is not really an option, I'd say.

I would add another answer (2.) if my contribution to the answer is more than adopt one or two lines of code or change some variable names. In the case you linked, the owner of the question could have posted the code in a separate answer and it would have made sense.

You must log in to answer this question.

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