What's the best way to write a post where the best answer for a question is to direct the poster to a white paper, presentation, or other document, that contains a lengthy subroutine, macro, or other code, and where the answer is effectively "use this"?

I realize this is not normally the best way to answer a question in general, but sometimes it is; this answer for example could have been a very good answer to the question (which was eventually edited to show a slightly different need). Achieving the specific desired results in a useful way takes considerable effort (a hundred or so lines of code at least).

I don't imagine including the entire macro that the paper contained would have been a good idea; and while the answerer did a pretty good job of adding some surrounding details, at the end of the day the answer for the poster comes down to 'run this macro'.

What is the expectation of answers like this? Are they acceptable at all; and if so, how much information should be provided in the post? What's the best thing to say to users who do post these, and it's clear they can't directly copy the relevant portions into an answer (without having a multipage answer)?

3 Answers 3


This is really a sub-case of Are answers that just contain links elsewhere really "good answers"? -- the answer is the same "If your answer is just a link pointing somewhere else its not a good answer because the link may eventually break."

If the relevant bits are too lengthy to include in an answer (hundreds of lines of code) you should at least provide a synopsis (algorithmic description, flow diagram, etc.) that someone could use to reconstruct the relevant / useful content on their own, without the linked content being available.

At this point the link is no longer "the answer" - it's "additional reference material".

  • 1
    So in this case, you would've described the steps, such as Run the PROC MEANS, creating one dataset per statistic requested, then combine them and transpose it to match your needs, and then included the link both as a reference for where you got the idea, and perhaps as "Here is an implementation of this that is fairly robust".
    – Joe
    Jun 7, 2013 at 17:48
  • @Joe pretty much - in this case an abbreviated illustration would probably be helpful for total newbies (reduce/simplify the input and output so you can easily follow it in your head), but the thumbnail sketch is probably adequate for someone who is familiar with what they're doing
    – voretaq7
    Jun 7, 2013 at 17:58
  • OK, thanks! I'll mention the thread to the specific user and keep this in mind in the future for my own posts.
    – Joe
    Jun 7, 2013 at 18:42

My thoughts: I think that you need to post enough information to make it clear to the poster that following the link is useful - ie, a description of what the subroutine/macro/code does. I'm not always sure how to do so (like in this case), but some effort should be taken.

If it is a paper from a presentation at a conference, posting which conference the paper was from is helpful to avoid linkrot; that way a later searcher can look for the paper on their own if the link breaks.


There is already a method for directing the user to such information: Google.

The purpose of StackOverflow is to provide full questions and answers. If it can't be done in this format, it shouldn't be here.

You must log in to answer this question.

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