8

I just edited an answer to correct the link rot, and I realize that the official policy is that it's better to include a copy of the function than to merely provide a link. However, the method is over 60 lines long. Since it's not my answer, I'm not going to substantially change what it says, but I do think it would be appropriate to include a more durable reference to the function mentioned. Stack Overflow doesn't have folding regions, and copying the whole function would cause clutter.

Is there any proper editorial technique besides rewriting (someone else's post) so as to not mention a whole function?

3
  • 7
    (1) Actually Stack Overflow does have folding region, if you abuse JS code snippet. (2) There is a limit on number of displayed lines anyway, exceeding that would show a scroll bar on the code block. (3) 60 lines is not that long.
    – user202729
    Commented Aug 7, 2018 at 8:48
  • 1
    @user202729 Feel free to post (2),(3) as an answer.
    – piojo
    Commented Aug 7, 2018 at 8:53
  • 1
    @user202729 It's pretty long for an answer Commented Aug 7, 2018 at 15:21

1 Answer 1

7

I know that it is lengthy code, but link rot is annoying for those that seeks help to find a problem on his/her question. If he/she ends up on that answer and wants to click the link, he/she gets a 404. That must be annoying. You can consider to search further. Yet, sometimes there are enough keywords to find back the code. Or at the other side: sometimes you cannot.

I would say: include the code with a reference to the GitHub repository (and preferably with a date when it got copied over). Just fill in the edit summary (I hope that I am not the only person that checks it) that the edit is made to prevent link rot.

4
  • 4
    When you include it, make sure that the source license is compatible with the cc by-sa 3.0 license used on SO.
    – BDL
    Commented Aug 7, 2018 at 7:27
  • 1
    That is a valid point yes. However, codes from non-public accessible sources (or published with licenses that does not allow reproduction) are not so lenient to be posted on StackOverflow IMHO. Yet you can take over the strategy of the code if there are no alternatives.
    – KarelG
    Commented Aug 7, 2018 at 7:39
  • 4
    and preferably with a date when it got copied over — better yet, link to a specific source control tag or commit. For example, on GitHub, you can press y to change the current URL to a permalink using the commit hash you are looking at.
    – Shepmaster
    Commented Aug 7, 2018 at 16:30
  • @Shepmaster Linking to a specific commit is progress, but it doesn't fully solve the problem of link rot. What if Stack Overflow outlives Git Hub?
    – piojo
    Commented Aug 8, 2018 at 0:43

You must log in to answer this question.

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