26

Should posts be self-contained; that is, should questions and answers avoid linking to outside material?

For example, I recently edited to inline code the author had put in a paste bin. Was that appropriate?

Return to FAQ index

4
  • I think: It doesn't matter. People will still point to external sources when SO won't satisfy their needs.
    – OscarRyz
    Commented Feb 6, 2009 at 2:19
  • 1
    @Oscar: People will do whatever they want, of course, but hopefully can be convinced by sound reasoning. And everyone with 2k rep. can help, too.
    – derobert
    Commented Feb 6, 2009 at 2:31
  • 4
    The last thing we need is to encourage even more wild guessing. The best answers are the ones with canonical links. Bad, bad idea. There's no halfway interesting question that doesn't get reasked and reanswered again every 3 or 4 weeks anyway.
    – le dorfier
    Commented Feb 6, 2009 at 2:40
  • Did you have a legal right to copy from Pastebin to SO? What license was the material on Pastebin under? This matters.
    – TRiG
    Commented Aug 23, 2011 at 16:06

7 Answers 7

36

Usually.

One of Stack Overflow's goals is to have answers be useful to people who show up months or even years later via Google. While cool URIs don't change and live forever, far too many are lame and ephemeral. Linkrot is a leading user frustration on the web as as far back as 1997; and you can be pretty certain a user who follows a Google link to Stack Overflow only to find his answer is 404-compliant will not be happy.

Even with cool links, it's an extra step to follow the link; it's a hard step if the relevant material is a small part of the linked resource. Self-contained questions are just better.

There are, however, certainly some times when external links are okay:

  • Links that we're confident will stay good. For example, Wikipedia's Link Rot article will probably still be around a decade from now, and with up-to-date information. MSDN will still be around, but beware they sometimes break old URIs.
  • The amount of relevant external material is huge, for example a specification.
  • Links which are supporting information only (e.g., citations) where the relevant bits are contained in the question or answer.
  • Evanescent links in questions are less problematic than in answers.
  • Often material can't be copy-pasted due to copyrights; it should be summarized/rewritten if possible.
7
  • I'd also specifically call msdn as a good place to send a link. Commented Feb 6, 2009 at 2:12
  • @Joel: Added MSDN.
    – derobert
    Commented Feb 6, 2009 at 2:14
  • 2
    msdn screws up old links on occasion too though Commented Feb 6, 2009 at 2:21
  • 5
    MSDN!? About a third of the links to MSDN I find in the wild tell me that page no longer exists. MSDN of all sites has a horrible reputation of dangling links. Commented Feb 6, 2009 at 2:27
  • @Steven: That sucks. Should I take MSDN out?
    – derobert
    Commented Feb 6, 2009 at 2:27
  • @Steven, @Robert: Ok, I've tried to fix the MSDN note.
    – derobert
    Commented Feb 6, 2009 at 2:28
  • Two of the linked pages are now 404s.
    – Someone
    Commented Jun 28, 2022 at 17:03
21

Personally I think the idea of not linking outside content is nothing short of ludicrous.

If anything, I think a lot of answers don't link enough outside content. My general policy is:

  • Never post a direct URL. Always give it a label like this not like this: https://stackoverflow.com/questions/518828/should-stackoverflow-be-self-contained.
  • Don't ever put link text of "click here". Put something meaningful. Instead of "To see an example click here" put "Please refer to Should Stack Overflow be self-contained?". The link text should be an accurate yet succinct summary of what the resource is and/or why you're linking to it. The title of the document is a good fallback position.
  • If you mention an API function or similar, link back to the "official" documentation, for example if I were discussing the jQuery ajax() function.
  • Try to keep what you write here succinct and pertinent and this is a judgement call but you don't want to be repeating everything that is posted elsewhere. There's such a thing as information getting lost in data.
  • Link to other relevant Stack Overflow questions and external questions, forum threads, blog posts and so on that further elaborate on the topic.

I wish more people would do the above (many do). I find the idea of not linking to external content to be nonsensical.

4
  • 5
    I agree with this, actually. I think I'm more going for, an answer should be supported and extended by the external links, but not dependent on them. If the "fragile" external links break, the answer should still be useful. (Fragile, as opposed to reliable ones like Wikipedia)
    – derobert
    Commented Feb 6, 2009 at 2:36
  • 1
    Your 'like this' example would be better if it were more meaningfully describe - a link 'like this' is not good. Commented Feb 6, 2009 at 3:25
  • So, I'm trying to see how "like this" is an "accurate yet succinct summary."
    – BobbyShaftoe
    Commented Feb 6, 2009 at 6:14
  • 2
    I agree that linking is good, but only if the link is something that is at least semi-permanent. Creating content in a paste bin for the sole purpose of linking to it on SO is a bad idea for a multitude of reasons.
    – TM.
    Commented Aug 29, 2009 at 22:53
7

In a similar vein, I think that Stack Overflow should provide image hosting, so that users that want to display an image or screenshot in their questions or answers will be able to do so without hosting it themselves or finding a picture on Google. This way there's no risk that the linked image will no longer be available when the poster loses interest in hosting it, or, if it was hotlinked from somewhere else, that the source moves or pulls the content.

This has already been suggested, and rejected, but then again that was several months ago and Jeff might be more receptive to the idea now.

1
  • 1
    There are, thankfully, reliable image hosting services, as noted in the uservoice comments. But, yeah, if we want SO to be self-contained, image hosting should be offered.
    – derobert
    Commented Feb 6, 2009 at 2:33
5

Answers that consist of a single link are generally bad, an answer should give an executive summary of the contents on the linked page, so even if the link dangles somebody later on will know enough to do the appropriate searching at least.

3

I think it's inevitable to want to add content that says: "well, look at where I got this information".

But it's always positive to try to include some of the information in the answer and use the link as reference or further research material.

I would say Stack Overflow shouldn't be self contained, but the answers should include enough information to be informative even without the links.

2
  • If the answers answer the question without the links, isn't that self-contained?
    – derobert
    Commented Feb 6, 2009 at 2:26
  • lol .. I mean yes.. I mean.. yeah...er..self contained in terms of the answer "having it" but not self contained in terms of "allowing" outlinks. :-) but I get your point.
    – Ric Tokyo
    Commented Feb 6, 2009 at 9:28
2

A self-contained answer is best, but links to expansive articles are also appropriate.

For example, the answer to several OOP questions on Stack Overflow is "the law of demeter". Explaining this in a sentence or two is fine, but a link to the Wikipedia article or some other source likely to be relatively permanent is good, too.

2

Sometimes, you need to include external URLs, because some content to help answering questions is in a book. For example, I love reading books. When I know something that I've done, it can be self-contained. However, when the solution is in a chapter of a book or in content that can have copyright, I must add a hyperlink.

You must log in to answer this question.

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