8

Currently (and, I assume, since SO’s/SE’s existence) all user-generated content is licensed under a copyleft license.

In the discussions The MIT License – Clarity on Using Code on Stack Overflow and Stack Exchange and A New Code License: The MIT, this time with Attribution Required, it is proposed to license some parts (code) of future user-generated content under a permissive license instead.

The given reason for this proposal is:

[…] it’s always been a little ambiguous how CC-BY-SA covers code. This has led to uncertainty among conscientious developers as they've struggled to understand what (if anything) the license requires of them when grabbing a few lines of code from a post on Stack Exchange. Uncertainty is a drag on productivity, for you and for us, and we feel obligated to make code use more clear.

Yes, CC BY-SA is not a good license for code, and yes, because of that it can lead to uncertainty in some cases. But this does not explain why the new code license should be a permissive instead of a copyleft license.

I’m aware that there are people who prefer permissive licenses and people who prefer copyleft licenses, and I know the disadvantages and advantages they see in these licenses. But the Stack Exchange communities are built on content licensed under a copyleft license, so it would seem natural to also use a copyleft license for code. And a copyleft license is the "safer" default for authors:

  • If code gets licensed under a copyleft license, authors can decide (per code block, per post, per account …) to license it under a permissive license (e.g., for use in proprietary software).

  • If code gets licensed under a permissive license, authors can decide to license it under a copyleft license, but that’s pointless, as their code can be used in proprietary software anyhow.

To change the license for code is one thing, but to switch from copyleft to permissive is a totally different story. I think that decision should come from the community.

  • 2
    Can you add a TL;DR about what is copyleft and what is permissive license? – Marco Aurélio Deleu Jan 15 '16 at 17:36
  • @MarcoAurélioDeleu: Maybe the question What's the difference between permissive and copyleft licenses? can be of help. My own tl;dr: Alice wants to publish an app. She uses code posted to SE in this app. If the code is licensed under a permissive license, she may do so without allowing anyone else to see/use her app’s source code (to learn from it, to ask questions about it, …). If the code is licensed under a copyleft license, Alice has to publish her app under this (or a compatible) copyleft license, allowing others to see/use the source. – unor Jan 15 '16 at 17:45
  • So with this question you're arguing that we should keep the copyleft model (or at least not change abruptly to permissive) and Stack Overflow users should only use Stack Overflow for open source projects? – Marco Aurélio Deleu Jan 15 '16 at 17:50
  • @MarcoAurélioDeleu: Yes, I think we should keep using copyleft licenses (unless the majority of the community wants to switch, but that evidence doesn’t seem to exist yet). -- And yes, if anyone (not just Stack Overflow users; you can even end up getting code from SO without ever having visited the site) uses that code in their published software, they have to make it libre/open. If they want to keep their software proprietary, they would have to contact the code author and ask (or the author could dual-license it under a permissive license, e.g. stated in the user profile or in whatever way). – unor Jan 15 '16 at 17:59
  • So, for copyleft: If the software made is not meant to be published, it does not have to be? – Simon Klaver Jan 16 '16 at 11:39
  • 1
    @SimonKlaver: Correct, that’s generally the case. You have to follow the (copyleft) license if you publish the work somehow (offering for download, selling, sending per email, etc.). If you don’t intend to publish (e.g., it’s only for your own private use, or for internal use in your company, etc.), you don’t have to follow the license (you wouldn’t even have to attribute). – unor Jan 16 '16 at 11:51
  • 1
    @MarcoAurélioDeleu. Code (and everything else) on Stack Overflow (and the rest of Stack Exchange) is already under a copyleft licence. – TRiG is Timothy Richard Green May 24 '16 at 20:18
12

When I was examining licenses for some content that I create, I came across the Free Software Foundation's "How to Choose a License for Your Own Work" page. Of course, their first recommendation is the GNU General Public License, a strong copyleft license. However, they do have exceptions to this:

  • For small programs (they define small as <300 lines), they recommend the Apache License 2.0. Although not compatible with GPLv2, it provides some terms regarding software patents. It also doesn't have a massive license text to carry around with the small amount of source code.
  • For libraries that implement free standards and must obtain widespread use, they also recommend the Apache License 2.0. It is easier to use this license in a wider variety of projects (closed source or open source, commercial or non-commercial) without the viral nature of GPL having an impact on your work - this promotes the general cause of free software. They also recommend the LGPL in cases where the library isn't competing against restricted standards.
  • For server software, they recommend the AGPL to ensure that users of the software over the network would have access to the source code upon request.

To be very clear: I don't like the GPL. I also don't like the LGPL or the AGPL. The LGPL is the least offensive, as it allows people to link to my code, but my concern tends to be toward maximum reach and usage, not forcing code or modifications to be open source.

So, at this point, the FSF, the champion of strong copyleft, has identified cases where permissive licenses (like Apache 2.0, BSD, and MIT) are good things. The way I read it, when it becomes too bulky to move around copy of a large license or it's more important to make the code widely used, they favor permissive licenses over strong copyleft licenses.

Let's now take a look at the mission of Stack Exchange. The whole point is getting solutions to problems. If you have a hard bug to solve in your code, you can post some code and a write up of what's going on to Stack Overflow. If you wrote some working code, but are having trouble making it better, you can post your code to Code Review. If you're having problems managing your project, you can ask on Project Management. On a number of sites - Stack Overflow, Game Development, Unix & Linux, Programmers, Programming Puzzles & Code Golf, Code Review, Mathematica, WordPress Developers, and more - the problems are in code.

Now, something to recognize is that not all code can be licensed. There's something called the threshold of originality. In the United States, you can only copyright something that has a "minimal degree of creativity". A lot of code samples or code snippets or MVCEs won't meet this threshold of originality. However, larger pieces of code will. So now, you have a large piece of code that took creativity to write posted on a Stack Exchange site (as part of a question or an answer). What now?

Today, it's licensed Creative Commons Attribution-ShareAlike 3.0 Unported. Yes, that's a copyleft license. It's important to recognize that Creative Commons says that their licenses should not be used for software source code or binaries, but it is in this instance. This question on the Open Source Stack Exchange has a lot more detail about the CC licenses and software. There are two problems with the license itself: it does not provide patent protections (like Apache or GPLv3, but in the same position as some other FSF and OSI approved free software licenses) and it does not address the distribution of binary files versus source files.

The other issue with CC BY-SA (which also exists with other strong copyleft licenses) is the ShareAlike clause. If I were to take software licensed CC BY-SA and incorporate it into a body of work that I wanted to keep closed source, that work must also be released under CC BY-SA. Not appropriate for many personal uses, but very inappropriate for company uses.

In order to achieve its goals to make programmers lives better, the source code must be available for use under a permissive license that allows software developers to incorporate it into a closed source application without fear. The best licenses to do this would be MIT, BSD 2-clause, BSD 3-clause, or Apache 2.0 - they are permissive and well understood by open source software developers as well as organizations' legal departments.

Why is source different than the text you may ask. The difference is that I likely will not incorporate the text into a closed-source software product. Chances are, you aren't going to be putting the text in such an application - you simply need to read it to help understand the code. It also ensures that the contributions to Stack Exchange are perpetually available and reusable to continue to grow the world's knowledge base - no one can do something evil. Even if they sell access to it, both the original SE content and the derived work are there.

  • Well, that probably works for Stack Overflow and any other site where you won't find fully working substantial code. The rest??... – Deduplicator Jan 15 '16 at 19:01
  • 2
    @Deduplicator I don't understand your point. Stack Overflow answers may have fully working and substantial code. WordPress Developers answers may have fully working and substantial code. Even answers on Programmers (especially when it comes to algorithms or data structures) may have fully working and substantial code. – Thomas Owens Jan 15 '16 at 19:05
  • Well, would insisting on a completely permissive license be good for a site such as codereview? (and I guess I dropped an original there...) – Deduplicator Jan 15 '16 at 19:16
  • 1
    @Deduplicator Honestly, no. However, there are problems with having different licenses for different sites. Also, the requirement of Code Review to post complete and functional code in CC BY-SA is also not good due to the problems with CC licenses and software source code. I am unable to participate on Code Review at work because of the license and choose not to participate on Code Review with many personal efforts for the same reason. I think the community of Code Review should come together on this matter (and maybe they are on Meta.CodeReview, I'm not sure) and come up with ideas. – Thomas Owens Jan 15 '16 at 19:21
  • I still can't quite decide whether I agree with this or not but +1 anyway for arguing the case so convincingly. – Ixrec Jan 15 '16 at 22:53
  • @Ixrec If there's anything unclear or that you disagree with, feel free to point out. I'd be happy to shore up any parts of my case that are lacking. – Thomas Owens Jan 16 '16 at 0:45
  • 1
    "In order to achieve its goals to make programmers lives better […] must […]": Well, I don’t agree with this goal unconditionally (if that were the goal, you could say that a license that doesn’t require attribution would make programmers lives even better). -- If I share my knowledge in the form of code, and Bob takes this code and publishes it himself (in the form of a software), I want that Bob has to share it for others, too, so that Alice can learn from it, just like Bob learned from me. If Bob wants to make proprietary software, he can ask me, or take my idea and reimplement it, etc. – unor Jan 16 '16 at 0:50
  • @unor Valid points. if that were the goal, you could say that a license that doesn’t require attribution would make programmers lives even better I suppose it depends on what side you're looking at - the programmer who created the work or the programmer who is using the work. Being attributed tends to be better for the programmer who created the work since it provides visibility and a clear communication of the rights of other recipients of the work. Not having to worry about attribution is easier for the user since they can just use the code and run with it. – Thomas Owens Jan 16 '16 at 0:53
  • 1
    @unor The part about Alice and Bob is, I think, the difference between copyleft and permissive. Permissive licenses let everyone learn from the source code, but everyone may have to go back to the source and it doesn't force future modifiers to make their work visible for others to learn from. It gives every content creator the option to make their software closed or open. – Thomas Owens Jan 16 '16 at 0:57
  • 1
    @unor Some environments cannot reveal their source, and wouldn't benefit from copyleft software. Corporations trying to maintain competitive advantages don't want their source code to be used and may prohibit incorporating software that is under copyleft. If you want your single thing to be useful to the widest audience, permissive is better. Even the FSF acknowledges this fact and says if you need wide dissemination and use of your software, use a permissive license. – Thomas Owens Jan 16 '16 at 0:59

You must log in to answer this question.

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