77

I want to cite Stack Overflow answers in scientific publications.

For example, I could be tempted to cite an answer that has provided a good benchmark analysis to a special problem (e.g. arrays vs. pointers).

But since basically anyone can edit the answer, such a citation won’t do. I need a reliable way of linking to a specific revision of an answer.

For answers that have already been edited, this can be done by looking at the edit history of a posting (e.g. once again arrays vs. pointers, different answer). But for at least two reasons, this is insufficient:

  1. It only works for answers that have already been edited.
  2. It only displays the Markdown source code as text/plain. Formattings included would be much preferable.

Furthermore, linking to isolated answers might not be enough; it would be much better if it were possible to link to a specific revision (kind of a snapshot) of a whole discussion, i.e. a question with all its answers and comments from a specific date/time.

Wikipedia solves this problem by providing each revision of a topic with a unique oldid attribute to construct a permalink.

Is there already a (hidden) solution for this? If not, I posit that Stack Overflow needs one.

By the way, I realize that this may be controversial but I think it’s completely fine to have Stack Overflow discussions as scientific references. After all, discussions in mailing lists, news groups and private communications are bona fide scientific references, and some of the answers here are prime examples of rigorous research.

(One solution would be to link the normal question, along with a “retrieved on” timestamp but I don’t particularly like that solution since it makes it much harder for readers of the publication to check the source.)


(I’ve seen “How should the Trilogy and Stack Exchange be cited in external works?” and “Stack Overflow as a reference in a professional paper/presentation” but these are different questions.)

0

6 Answers 6

45

We also have official citation support, but this is enabled only on cstheory and math at the moment.

http://meta.math.stackexchange.com/questions/1876/what-is-a-good-standard-for-publishing-a-reference-to-a-stackexchange-thread/1902#1902

link menu panel

citation panel

We now also support deep linking directly to a particular revision; each one has a link next to it:

deep link to revisions

Like so:

https://stackoverflow.com/revisions/7153659/7

1
  • 1
    For stackoverflow I have an issue with linking to answers with only a single revision. There is no way to access that particular revision? Commented Mar 1, 2013 at 15:33
27

As I said in the comment in the other question, I agree.

There should be a proper permalink system to link to revisions. The GUID URLs are fugly, and they provide source code only - making them effectively useless for use in a publication. (Update: It is possible to link directly to propely formatted versions [yet still with fugly URLs]. See S.Mark's answer for details.)

A permalink scheme like

stackoverflow.com/revisions/12345/8

(or whatever)

would really be in order.

I feel this is something SO simply should have as a growing major resource on programming, no matter whether the feature is going to be used ten times, or ten thousand times a year.

0
10

Probably, more user-friendly version of following URL will be needed, as Pekka mentioned.

https://stackoverflow.com/posts/233293/revisions#revd373d0c9-db98-4664-9749-4dec41e80a40

Above link points to Formatted version of certain version

5
  • Awesome! I’m still holding out for a whole-discussion snapshot permalink and for reliable, user-friendly links (@Jeff, are we guaranteed that the <div> ID doesn’t change?) but for the time being, this is quite a good solution. Commented May 13, 2010 at 15:47
  • @Konrad, I have updated my greasemonkey script to add those links, but of course, official support would be great.
    – YOU
    Commented May 13, 2010 at 15:54
  • 1
    Great stuff, this solves a big part of the problem already.
    – Pekka
    Commented May 13, 2010 at 17:32
  • Yes, it works. Here is another example, revision 8 of a post with 9 revisions: stackoverflow.com/posts/28811/… Commented May 13, 2010 at 20:41
  • completed; see my revised updated answer Commented Sep 1, 2011 at 6:06
7

The new “history” feature of questions provides a good solution to the problem of citing questions. For example, this discussion can be cited by linking to the appropriate history timestamp and sort in ascending order:

https://meta.stackexchange.com/posts/49760/timeline?asc=True#rev-497602010-05-13-01-48

3

Well, there is a GUID associated with every revision, and you can view source on it, so..

https://meta.stackoverflow.com/revisions/e65962f8-0879-406e-9fdc-d70dfce1b013/view-source

for example.

Not optimal, but honestly, this has never really come up in ~2 years of SO until now.

5
  • 7
    But how do I get the revision of an answer that hasn’t been edited yet? And from that view-source view, how do I get back to the corresponding question? As for why this hasn’t come up before, I believe it’s only a question of time. It probably hasn’t come up in the first two years of Wikipedia, either. But SOFU is starting to accumulate some content that is worth citing, much more so than Wikipedia (which after all is “only” an encyclopaedia, not an original source). Commented May 13, 2010 at 13:53
  • 2
    Totally agree with @Konrad. A proper permalink system to link to revisions in a parsed (= not only view-source-y) way would be really great... Including better URLs like stackoverflow.com/questions/12345/revisions/8 to make the URLs usable in publications. Will be needed increasingly the more serious content the sites start to accumulate.
    – Pekka
    Commented May 13, 2010 at 14:01
  • 4
    @Konrad, for first question, I've written a greasemonkey script before here, thats add revision links to all the questions and answers.
    – YOU
    Commented May 13, 2010 at 14:02
  • @SMark: Thanks, that’s something, at least. Commented May 13, 2010 at 14:17
  • 3
    For those who don't use the greasemonkey script, the URL for a revisions page works even if the post hasn't been edited. Example: meta.stackoverflow.com/posts/49761/revisions
    – Grace Note StaffMod
    Commented May 13, 2010 at 15:06
2

Stack Overflow is like Wikipedia, in that you should rarely cite Stack Overflow directly in the same way that you should rarely cite Wikipedia directly. If you often cite Wikipedia in scientific or academic publications, you're doing it wrong. Instead, you use either resource (Wikipedia or StackOverflow) as a starting point that will point you to something more authoritative and citable — perhaps a link to the official documentation or something similar.

There are exceptions, of course, but generally the solutions posted on StackOverflow are implementations of patterns better documented elsewhere, or samples that demonstrate a programming feature where you'd do better to point to the original documentation for that feature. This generally holds even if the content or exact example in an answer is original. Any answer worth citing is gonna be using techniques that have real academic names and documentation, and that's where you need to point.

Again, an answer may be truly exceptional and worth citing if it provides a truly excellent implementation of an academic principle or pattern or if it creates something truly novel, but the former should always be cited along with an academic reference for the original pattern and the both are exceedingly rare.

5
  • 14
    I respectfully disagree. Stack Overflow is not like Wikipedia in this respect. Wikipedia is an encyclopaedia. It collects information rather than generating them. That’s why it’s a bad original source – it isn’t one, by definition. Stack Overflow is completely different: here, content isn’t merely collected but generated – take my benchmark example. The benchmark code, along with its results, would fit perfectly as a source in a scientific publication even if doesn’t merit its own scientific publication (but only because of the limited scope). In a way, SO is even peer-reviewed. Commented May 13, 2010 at 14:12
  • 2
    Hmmmm. I'm not an academic person but is this comparison really entirely valid? In addition to encyclopedic information, SO is also a platform for new solutions, theories and otherwise "original content" that is not published anywhere else. Plus, different from an encyclopedia, there may be the need to quote Stack Overflow contributions for example in a sociological context when the SO contribution is the actual object of the publication being written. (Update, Konrad beat me to the punch with similar arguments :)
    – Pekka
    Commented May 13, 2010 at 14:14
  • 1
    There are exceptions, of course, but generally the solutions posted on StackOverflow are implementations of patterns better documented elsewhere, or samples that demonstrate a programming feature where you'd do better to point to the original documentation for that feature. ...hmm... promoting this to my answer. Commented May 13, 2010 at 20:06
  • 1
    Another thing to consider is that, unlike even Wikipedia, there is no framework in place for attribution or verifiability other than the original poster's word. While you may find that an answer will work, unless the author chose to include citations (which is what you would have to reference in an academic article anyway), you have no idea where the author got it from: whether he synthesized it himself or ripped it off/"borrowed" it from someone else. Preserving the chain of knowledge is important, especially in an academic setting.
    – user149432
    Commented Dec 10, 2010 at 22:25
  • (Yes, I'm late to the discussion.) Do keep other SE sites than SO in mind. CrossValidated, for instance, generates content that is certainly citeable, as a small incremental advance in statistical knowledge. Often answers reflect "statistical folklore" that is not immediately obvious, but is not in itself sufficiently important to warrant its own "standard" publication - but certainly citeable. I recently had a paper published that cited two CV threads, and it definitely was the better for it, and I wouldn't have known what else to cite there. Commented Feb 4, 2017 at 16:57

You must log in to answer this question.

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