Recently when I was checking one question at SO I found that one user has answered the question with a link to an article which presents an answer to this question.

After some minutes another user has posted an answer by copy-pasting code and a example from that same link (That user has also included a link to the article in his answer, and that's a good thing).

Now which one is better?

The link is good because if the user updates that article you get an updated answer automatically on SO.

The copied code is good for two reasons :

  1. Users can directly see it and review it (Sometimes they are too lazy to check links) and so you get up/down votes more quickly.
  2. If somehow the link breaks in future, SO will still have the answer.

What do you think?

  • 5
    Copyright is also an issue with copying and pasting.
    – mmx
    Sep 7 '09 at 12:44

You've answered your own question.

Posting the relevant excerpt and the link is best. It keeps the information on SO (or SF, or SU) but references the original source. It's also insurance against link rot.

  • But still sometimes user paste their own code, no links, and then you have to struggle in order to copy it. Nov 15 '09 at 22:29

You must log in to answer this question.

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