41

I've recently observed that a user frequently includes links to a zip file on a file sharing website in their answers. My gut tells me that this behavior should be discouraged, mainly because referring to zip files on an external file sharing website is prone to link rot and malware infections. In a certain sense, these are similar to jsfiddle links. A significant difference is that the external code (zip) runs directly on the reader's computer instead of a sandbox (the browser) though.

Is it OK to share files with Dropbox and other file-sharing services in posts? asks a similar question, but the answer mainly focuses on posts that are incomplete without the zip file, while the answers of the user in this question are already complete without the zip files.

I suggested to remove the zip files from his answers by mail (included below with his permission), where it became apparent that there is no document that states the (official) policy for linking to zip files from answers on Stack Overflow. So, what is our policy on linking to zip files on external file sharing websites?


My mail:

I've seen some of your recent answers on Stack Overflow and noticed that you frequently include a link to a zip file on an external file hosting site. This behavior is frowned upon on Stack Overflow [1] because there is potential for link rot and malware. Your answers are already complete without them (excellent!), so it would be nice if you go over your recent answers and remove the link to these zip files.

Reply to me:

They are meant to help people understand the answer itself Lots of users always get stuck in coding even if my answers are right and keep asking for help in the comments, so giving them a working example is the fastest and better way to solve their problems. I'm not violating any policy of the site doing it; the answer you linked is only opinion based. Link me an official SO policy page saying that external hosted files are not allowed and I'll remove them immediately.

Second reply from me:

Posts (questions and answers) ought to be self-contained. If the asker cannot understand the answer without the contents of the zip file, then you need to move the relevant parts of the zip file into your answer. Moreover, these links can expire (or the file sharing websites could be blocked by firewalls). which makes them useless for other/future readers. When your answer is already useful in itself, then there is no need for the zip file any more, since readers can copy-paste the relevant snippets from your answer into their code.

Second reply to me:

I believe you are right, yes, but I always include all the relevant code in my answers (you can see it), however users usually don't get it right and continue asking questions in comments until I give up on answering on that comments and link them a working example (which usually solves the discussion). Given that, I started adding .zip files to answers about Chrome Extensions at the first step to prevent these comment-discussions.

3
  • 1
    Do you have a specific example? If people are providing a zip file in addition to code in a post, I see no issues with providing the zip with all of the code and media files. (assuming that people can see the difference between manifest.json and manifest.json.exe.)
    – Lekensteyn
    Commented Oct 26, 2014 at 13:46
  • 1
    Here are two examples: stackoverflow.com/a/26424086 and stackoverflow.com/a/26451886. I want to keep the discussion generic though: Assuming that the post is complete, do we want to discourage/encourage the linking to zip files (that contains more code that is not in the answer but not required to understand the answer)?
    – Rob W
    Commented Oct 26, 2014 at 13:55
  • I certainly do not view a link to a zip file (or any sort of web site) as sufficient to be considered an MCVE and therefore avoid an off-topic close. I commonly vote to close questions which only link to the code (whether zip or not) vs including the critical portions in the question.
    – Hot Licks
    Commented Oct 29, 2014 at 2:49

3 Answers 3

15

I think past post history on MSE has shown that linking to file sharing sites to assist with an answer has been permitted in the past. As you state, the answer would need to stand alone without the need to download the zip file to prevent linkrot. For that reason, I don't think we should explicitly encourage the practice of including zip files in answers. But continue to allow zip files where the answer can stand alone.

Would I download and unzip something from a random Stack Overflow user? Probably not. But if that file does indeed assist in answering the question? Why not? If someone finds something sketchy in a zip file, the person could easily edit the link out of the answer, leave a comment warning others about it, etc.

4
  • 11
    These three discussions that you're referencing are over 3 year old. Even back then, there was no clear consensus in linking to external files. Considering that SO has become stricter in external links, I think that too casual use of zip files is not something that we will recommend. For complex projects with many artifacts, fine, but for two or three small files that could have been inlined in the answer, I'd say no.
    – Rob W
    Commented Oct 26, 2014 at 14:41
  • 1
    @RobW I think it will create a grey area which isn't a good thing. Sounds like we both agree that we shouldn't explicitly endorse people providing zip files. But creating a rule where it's okay to share a zip for complex projects but not okay for small examples will only confuse people and make people unhappy. The answer should stand alone complex or not. Zip file should only complement the self sustaining answer (hopefully with all code in the answer).
    – Steven V
    Commented Oct 26, 2014 at 14:59
  • 1
    @RobW Anyway, in just about every case, if it is complex/big enough to need such an external zip-file, the poster failed in reducing it to the essentials. (Though that applies stronger to the question than any answers.) Commented Oct 26, 2014 at 17:55
  • So ... Stack Snippets should be expanded to cover small C++ projects with a Makefile and a couple of header files, the necessary build infra to pull in external libraries, etc?
    – tripleee
    Commented Oct 27, 2014 at 6:19
5

It seems fine to me as long as the salient points are all covered in the answer itself - so this is just the icing on the cake.

As someone that has dabbled in Chrome extensions I found the self contained samples in the product documentation useful and this seems in the same kind of spirit.

If it makes the answer more useful for people perhaps getting started in that area and writing their first extension, without having to add an explanation of the basics to every answer then what's the harm?

Slightly more knowledgeable users will see how to incorporate the code into their own extensions directly without needing the full worked example.

2
  • 3
    Do you make a distinction between zip files from developer.chrome.com and rapidshare? I perceive the latter as less trustworthy than the former, both in terms of availability and actual content. Maybe I'm too paranoid? ;)
    – Rob W
    Commented Oct 26, 2014 at 16:26
  • Regarding availability we are only talking about "bonus content" anyway so no disaster if it is lost. I have no idea whether rapidshare guarantee to host it perpetually or not. If not clearly it would be beneficial to choose a host that does. Regarding content it is up to the user to make a decision about the trustworthiness of the content. Same as a zip file linked from anywhere else on the web. Commented Oct 26, 2014 at 16:33
1

(for this discussion, please assume the answerer either authored the off-site resource or has explicitly permission to copy and derive new works from it)

Would you have a problem with a complete answer including a link to a well-written blog post or tutorial, that contained the download link for a starter project? Probably not.

What about an answer that is ONLY a link to a well-written blog post that does answer the question very well? That would be bad, because of possible link rot, and because it's hard to evaluate and vote when the content is off-site. We would tell the answerer to bring the relevant portions into the answer right on SO.

What if the download link and explanation are integrated with the most critical portion of the answer. Would you suddenly advocate for a signpost answer instead of bringing that content to SO? Would you want just a portion of the content copied over as a teaser, but still needing to visit the link? Or is it better to bring across the entire explanation, downloads and all?

I think we need to welcome links in answers to offsite downloads, just as we welcome links to offsite information that itself links downloads. Anything else creates a barrier to hosting the information on SO.

3
  • I have to admit I didn't really understood your answer. :/ Could you try to re-phrase it? Maybe more direct sentences? Commented Oct 28, 2014 at 19:48
  • 1
    @J.C.Leitão: Does that summary clarify things for you?
    – Ben Voigt
    Commented Oct 28, 2014 at 21:11
  • much better. Now I understand what you wanted to say. Commented Oct 29, 2014 at 8:14

You must log in to answer this question.

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