38

Sometimes when I review edits in the Suggested Edits queue, code or text from a linked pastebin is edited into the question. Is this encouraged? Should this be approved?

4
  • 7
    Does it improve the post? Was the code from a link the OP provided? If yes to both I see no problem. Commented Dec 12, 2016 at 19:04
  • 1
    If Pastebin contains nothing but code barf, don't edit it
    – Machavity Mod
    Commented Dec 12, 2016 at 21:35
  • 9
    I personally ignore questions which require looking at another site (any other site).
    – undefined
    Commented Dec 13, 2016 at 1:54
  • 6
    No. If the question is not complete and self-contained as written, then it should be closed. Because of licensing issues and a lack of an MCVE, only the person who originally asked the question can reasonably be expected to add code.
    – Cody Gray Mod
    Commented Dec 13, 2016 at 10:25

3 Answers 3

15

As of 2023, the Pastebin license doesn't allow reposts anymore.

Section D5 (License Grant to Other Users) of the Pastebin TOS states (emphasis mine):

Any User-Generated Content you post publicly may be viewed by others. By setting your pastes to be viewed publicly, you agree that you are allowing and authorizing other Users to not only to view your pastes, but you also are granting each User of the Website and the Service (as well as Pastebin itself) a nonexclusive, worldwide license to (a) use, display, and perform Your Content through the Website and the Service and to reproduce Your Content on the Website or through the Service as permitted or enabled through the Website’s or the Services functionality (for example, through cloning, embedding, or other similar tools offered on the Website), and (b) use such Content in studying and/or creating products and services of their own, but not to otherwise redistribute or republish Your Content outside of the Website or Service without your separate permission.

Edits that copy/repost content from Pastebin should be rejected unless it is absolutely clear that permission was given or that the author of the Pastebin is the one who reposts the content.

0
42

In general, yes. Questions should be self-contained, i.e. all information must be in the question itself and not depend on external links (which may break).

There are exceptions, though. If the pastebin is 1000 lines long, the question doesn't become any clearer just by pasting the code itself; the OP needs to provide an MCVE, not just a code dump. Another exception would be a case like this:

Can you please fix my code?

http://pastebin.com/12345

in which, even with code, it is unclear what the OP is asking.

10
  • 2
    Why shouldn't the code in your last example be edited in? Is it because the question is so bad that you shouldn't even waste time editing it in and the question should just be closed? Commented Dec 12, 2016 at 19:27
  • 12
    @KodosJohnson Glorfindel's answer mentions this: because the pastebin's code is not an MCVE. Don't edit code dumps into a question; that responsibility belongs to the OP, who must determine what code is relevant and what code is extraneous.
    – TylerH
    Commented Dec 12, 2016 at 19:29
  • 18
    There's a bigger concern here, though, and that's that the license for pastebin might not be the same as the license for SO. It really might not be OK to copy code from pastebin to SO if it's not your code. I've written about this in this answer to another question, for instance. That answer says that code should be edited in, but really only by OP. It's not, in general, possible to make sure that the licensing issues are addressed by an editor, and so edits that copy code from elsewhere should be rejected in the edit queue. Commented Dec 12, 2016 at 21:25
  • 1
    @JoshuaTaylor that's a valid concern, but 9 out of 10 times it is the OPs own code in the pastebin. Or, to make it even more complex, the OP might have copied the code from somewhere else without attribution. We honestly can't expect our editors/reviewers to check this all. Why do you think there is no rejection reason 'copied content' for question edits, while there is one for tag wiki edits?
    – Glorfindel
    Commented Dec 12, 2016 at 21:53
  • 16
    @Glorfindel It's not a question of whether it's OP's code or not; it's a question of whether OP wants it licensed under the terms that SO imposes. E.g., if OP posts code on OP's own website and links to it from SO, it can still be whatever license OP wants. If OP posts it to SO, then it's under whatever license SO imposes. It's not a question of authorship; it's a question of OP's licensing intent. I agree that it's unreasonable for edit reviewers to try to figure this out; that's why the editor should instead leave a comment asking OP to post code here, and perhaps downvote as no MVCE. Commented Dec 12, 2016 at 22:21
  • 10
    @JoshuaTaylor Maybe you should write that as an alternative answer...
    – hyde
    Commented Dec 12, 2016 at 23:16
  • 1
    @JoshuaTaylor I feel (but YMMV) that this happens once in a million questions. Agreed, a comment would be marginally better than an edit (especially if the OP is still online), but a lot of OPs don't know (or don't want to use) the edit link. In the very rare case of an unwanted pastebin transfer, the OP can always rollback (and ask the SE team to remove the revision), and specify clearly that (s)he doesn't want the code to be on Stack Overflow.
    – Glorfindel
    Commented Dec 13, 2016 at 7:58
  • 1
    What happens more often is that OPs state that they don't want to put their code on Stack Overflow because of a confidentiality agreement, but then they won't post it on pastebin either.
    – Glorfindel
    Commented Dec 13, 2016 at 7:59
  • @hyde additional answer given
    – Cœur
    Commented Apr 11, 2017 at 16:50
  • @JoshuaTaylor and Glorfindel those are both valid points, Joshua please post your as an answer.
    – smci
    Commented Jul 9, 2019 at 2:16
4

To address the legal concern, Pastebin content was CC-BY-SA (it was written in the footer up until 14th of October 2020), so (unlike jsFiddle) yes it's legally fine to reuse old Pastebin on Stack Overflow given that it was published prior to 2020/10/14 and that you attribute the author (in the edit description for instance).

To address the practice, yes editing is encouraged, as otherwise questions lacking an MCVE in the post itself would be closed and later potentially deleted.

4
  • 1
    With the caveat that you shouldn't bother doing it if the question is otherwise horrible, especially if you don't have the rep necessary to bypass the Suggested Edit queue, since you're taking up other people's time. Commented Apr 11, 2017 at 16:53
  • 1
    Where are you seeing the CC-BY-SA info in the footer nowadays?
    – genpfault
    Commented Aug 11, 2022 at 15:19
  • 1
    @genpfault good catch. From WayBack Machine, the change occurred around 2020/10/14-2020/10/15.
    – Cœur
    Commented Aug 12, 2022 at 13:46
  • Well dang, that's a bummer :( Thanks for digging that info up from Wayback!
    – genpfault
    Commented Aug 12, 2022 at 13:54

You must log in to answer this question.

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