16

In an opened issue against a BSD open-source library, an OP states that the mere presence of a single URL to a Stack Overflow article in a code comment section makes the entire source code copyleft, and therefore completely violates the BSD license.

The OP uses the magic word "lawyer" to backup his claim, with no further explanation, which is good enough to have the pleasure to trigger panic among open source library users (aka "you are too dumb to understand and argue, just shiver and do what you are told obediently").

While the OP claim sounds implausible, the mere fact that this line of thought can be weaponized on the back of confusing lawyer jargon should be of concern to Stack Overflow, because it sends the message that Stack Overflow is too dangerous to use or reference, and therefore should be actively and systematically removed from any code base.

I presume it would be preferable for Stack Overflow to officially clarify a stand on this topic, to reduce risks that exact or similar rumors and school of thoughts spread like wildfire among open source communities.

edit : to paraphrase the answers collected so far, the claim that a link to a SO article makes the entire (open source) code base copyleft is complete BS, and shouldn't be taken seriously.

However, the problem is more the perception that it might be a concern by some open source users, which could end up rejecting the open source code base on such baseless claims. This perception is fueled by another different issue around copy/pasting code from SO (not at stake here), which SO decided to license under a copyleft license (with "copyleft" definition being in itself a vast minefield). However, due to this possibility, some users may scan the code base with automated tools which instantly flag any SO url as potential source of problems and just complain point blank, without investing a single second to understand if the claim makes sense or not. This in turn leads to massive amount of energy lost in defending the SO url mention vs BS claims.

The end result of all these shenanigans is that, yes, it takes less energy to pro-actively erase any trace of SO within an open source code base, rather than continuously arguing about the sanity of the claims. This is a pity (yet another victory for entropy), and arguably a net negative for SO notoriety, but it's also not the open source developer's fault, who are not paid to waste their time defending the presence of SO links into their open source code base. Rather, it's up to SO to ensure that no confusion can arise from their licensing policy.

10
  • 3
    Every single page on Stack Overflow states (at the time of posting, and in the bottom right) "user contributions licensed under cc by-sa. rev 2021.10.20.40515". That includes articles, such as this one. If the user has posted a collective article, it is under that licence. If it is also licenced under a more restrictive licence else where, the point is moot, as someone referencing the content can just reference the one on Stack Overflow.
    – Thom A
    Commented Oct 20, 2021 at 19:12
  • 3
    Though, I will admit it would be nice if the share link on Articles stated that like on questions/answers.
    – Thom A
    Commented Oct 20, 2021 at 19:16
  • 1
    The question is not about copy/pasting the content of a Stack Overflow article, it's about just having an URL to one. Do you imply that the mere presence of an URL is exactly equivalent from a license perspective as copy/pasting the content of the Stack Overflow article ? What about referencing the title of a book then ?
    – Cyan
    Commented Oct 20, 2021 at 19:17
  • 7
    So what is your question here, exactly? I read it as "What are the articles licenced under"; is that not what you are asking? If you're asking about the implications of the licences, I don't think here is the right place for that. More likely you should be asking on Law.
    – Thom A
    Commented Oct 20, 2021 at 19:20
  • That's a good point. I will clarify the question, and eventually move it to Law is need be.
    – Cyan
    Commented Oct 20, 2021 at 19:50
  • Just curious: does anyone have a link to the original issue? Commented Oct 21, 2021 at 9:22
  • 4
    Does this answer your question? Can we get some explicit clarification on the *intended* legal usage of code from SO answers?
    – nvoigt
    Commented Oct 21, 2021 at 10:00
  • Thanks for the suggestion @nvoigt. The question wasn't about copying code from SO, but only about linking to an interesting SO article explaining a complex logic, without any code involve. So I believe they are 2 separate questions.
    – Cyan
    Commented Oct 21, 2021 at 23:17
  • As an aside, real lawyers (at least ones from the US) tend to go through a song and dance about how they are not offering tailored legal advice, because that would make them responsible for the recipient acting on that advice.
    – Haem
    Commented Oct 22, 2021 at 7:08
  • "Does a link to Stack Overflow in an open source library mean that that library must be copyleft?" That would be very weird, wouldn't it, so the likely answer is no. Just because somebody said something somewhere doesn't mean it's true and just because someone wrote down a link to a site somewhere you can't really conclude anything, I guess. Commented Oct 23, 2021 at 7:08

2 Answers 2

26

I am not a lawyer.

I am, however, an open source library maintainer who takes care to avoid licensing issues.

To address the question title, "Does a link to Stack Overflow in an open source library mean that that library must be copyleft?" note there are two types of copyleft. Strong Copyleft (the derivative work must use the same license) does not apply here. The target library does not become CC-BY-SA licensed. Weak Copyleft does not require the target library use the same license, but may contain other requirements as part of the license.

It is my (non-lawyer) opinion that the attribution requirement does not disappear when Stack Overflow code is copied, and thus it falls into the "share alike" category (of weak copyleft) in imposing additional legal burdens on the users of the code to maintain this attribution. This is likely the concern of the OP here.

Your comment clarification regarding a question whether "the mere presence of an URL is exactly equivalent from a license perspective as copy/pasting the content of the Stack Overflow article" doesn't seem to be directly relevant -- the URL isn't licensed. However, I suspect the URL is in a comment stating that some portion of the code nearby was derived from that link. It seems likely that it is the code's author's attempt to attribute the source of the code in accordance with the CC-BY-SA license. From Stack Overflow's perspective, this may be fine (see the license itself for specific attribution requirements).

From the perspective of a library, however, it may not be fine to have code that imposes an additional requirement on users of their code. Specifically, the Apache Software Foundation has made it very clear that Stack Overflow-sourced code is not permitted in its libraries (without a separate approval by that author).

While my own library is not Apache licensed, I know my code is consumed by Apache products and having code copied from Stack Overflow in my codebase may limit my code's usefulness to those products. Thus I do not permit code in my repository which was sourced from Stack Overflow. This may be the same perspective the OP in the BSD-licensed project is taking.

Now, if the Stack Overflow link is merely describing an approach and you've implemented it without copying the code, you're fine from a licensing standpoint. But in this case, the URL will still trip up scripts which search for that URL and create issues, causing more work for people evaluating your code to see if it's compliant or not. You could add a lengthy discussion in a comment justifying why you aren't violating a license. Or, you could just not include the URL to avoid catching the attention of the scripts and the time spent by future reviewers who may want to independently and repeatedly confirm there's no license issue.

9
  • 2
    What if no stack-overflow code was copied, and it's just an URL to a wall of text ? If I understand your answer correctly, CC-BY-SA should be a non-issue with regards to the open-source license of the code (BSD) ?
    – Cyan
    Commented Oct 20, 2021 at 22:00
  • 1
    @Cyan If it's just a URL and does not reference anything from the pointed-to link, why is it even there? There are scripts that people run to search for that URL in comments because they usually indicate that someone derived code or an algorithm from the link. If it does not denote that, it may not be "wrong" but it sure is confusing why it's there in the first place, and is best avoided. WIthout specifics, it's hard to say. What is the link? What is the nearby code? Commented Oct 20, 2021 at 22:10
  • 2
    Any concern about code published to Stack Overflow being inhibited from inclusion in Apache can be obviated by simply supplying an Apache (or compatible) license to said code in your user profile. Commented Oct 21, 2021 at 0:54
  • 1
    @RobertHarvey I think the license options in my profile are compatible. :-). But more seriously I think this is someone else's code; you can't just take it from one of their posts, you need their permission (either via a profile note regarding their licensing or specific contact with them). Or, just read the answer to see "how" to do it and go write the actual code yourself. Commented Oct 21, 2021 at 3:44
  • CC also has -ND which means No-Derivatives. Since -ND isn't in the license, there shouldn't be any problem deriving something. Commented Oct 21, 2021 at 14:57
  • 5
    @DanielWiddis I think Cyan is saying that you can "reference" things in an SO answer without outright copying code. Licensing is a copyright thing and doesn't protect ideas. If somebody has an answer describing an algorithm, and I implement code based on it, the SO link helps explain it, but the licensing rules don't effect my implementation at all.
    – mbrig
    Commented Oct 21, 2021 at 20:30
  • @mbrig I agree, and that's the correct way to do it. Unfortunately, there are scripts out there which search for the Stack Overflow URL to try to catch license issues, and they are dumb. It is far more work to add more comments to document how the link inspired the change but it was written separately.... I just avoid including any URLs at all to avoid catching the attention of those scripts. Commented Oct 21, 2021 at 20:50
  • 1
    @mbrig interpretation is correct : the link to the SO article is just a way to explain a relatively complex logic as to why things are done a certain way. But there's no code copy pasted from there. Now, I certainly understand also the issue that "if someone just have a script scrubbing for SO url and immediately flag any SO URL as "RED ALERT!!!"", then it's a lot of effort to explain every time why it's a false positive, even if it's blatantly obvious, since dumb scripts don't "think", they just brutally "apply". And by extension, users of these scripts act the same way.
    – Cyan
    Commented Oct 21, 2021 at 23:14
  • 1
    Along the same lines as mbrig's comment, I frequently add links in code to SO answers which explain why something strange must be done "You can't do <expected thing> because < reason> see <SO answer URL>". These are not links to code, but links to knowledge. To the very best of my knowledge, this is simply citing and not copying content. Commented Oct 22, 2021 at 11:20
20

[] states that the mere presence of a single URL to a Stack Overflow article in a code comment section makes the entire source code copyleft

The OP uses the Magic Word "Lawyer" to backup his claim

That is complete and utter nonsense. If they actually had asked a lawyer, they would have been laughed out of the room (and asked to pay for two full hours because the lawyer could not stop laughing afterwards).

A link is by definition not copy-rightable. Just imagine it were? Posting a link to twitter? Sharing a post on Facebook? Sending a NYT article to your mom? The whole internet would be a string of copyright violations. It's core mechanism would be copyright violations.

You cannot copyright just anything. I'm sure someone on Earth said "Hi Steve" first. That guy does not have a copyright on "Hi Steve". Your "creation" needs to be of a certain level to be able to be protected by copyright and "Hi Steve" does not cut it, just as a computer generated number sequence that makes Stack Overflow links does not.

So what if the open source library maintainer had read an article on Stack Overflow, learned from it and then wrote their own code based on what they learned? Still not a copyright violation. Just imagine it were? We all had that book that explained loops, right? Whether it was in school or at university, or self-taught, there was a book and one of the first chapters were loops. Do you think you break that books copyright every time you program a loop now? No, obviously not! Learning from something and deriving your own knowledge is fine.

So what if the library maintainer copied a large code snippet from Stack Overflow verbatim? Well... that would be stupid. That is not what you should do. Stack Overflow is to ask a question (probably a very shortened MCVE that when posting does not break your own code's copyright, your employers for example), get an answer and then learn to transfer the knowledge of the answer to your real program. If the link leads to a site where the maintainer had copied the code from verbatim, yes, you are in a place where you need a lawyer to find out if that is in compliance with all involved licenses. I would insist that the link itself is not the problem and the wording makes it seem like the one who brought it up never actually saw a lawyer about this because lawyers tend to be very obsessed about details and would not make such a beginner mistake, but just to be sure, yes, if the maintainer copied something verbatim, you are in a realm where it is all about the law.

But assuming they didn't... that claim is wrong. Trivially proven to be wrong, without even a lawyer. Is there a risk that people can sue you over obviously stupid stuff in your country and you will have to pay large sums of money just to defend yourself? I don't know. You will need to figure that out.

1
  • 1
    I'm not sure the "Hi Steve" argument is comparable. The phrase would be too short, containing too little original work and have been in common use for too long that correct attribution is no-longer possible. Most countries have an age limit on copyright too. None of these reasons really apply to URLs. A better analogy would be book titles. You can compile a list of book titles, the author's name, publisher name year of release etc... and ownership of that list would not be attributed to the owners of the books, but you for doing the work in compiling it. Commented Oct 22, 2021 at 11:32

You must log in to answer this question.

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