# The MIT License – Clarity on Using Code on Stack Overflow and Stack Exchange

Update (Dec. 22, 2015): Thanks, everyone, for your feedback to this proposal. We're going to digest this one over the holidays and should have a follow-up announcement answering your questions and addressing your concerns after the new year. We won't be making any hurried decisions on this topic, and certainly not without ample opportunity to integrate your ideas into the final decision. So continue letting us know what you think. You'll hear again from us soon.

Update (Jan. 14, 2016): The promised follow-up is here, requiring attribution and postponing the change to March 1, 2016.

CC-BY-SA is an ideal license for a crowdsourced knowledge base. We’ve benefited immensely from it, our community has gained protection through it, and we look forward to CC-BY-SA continuing to cover prose contributions to Stack Overflow and across the network for all of eternity.

But code is a bit different (pun intended), and 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.

Starting Feb 1, 2016, all new code contributions to Stack Overflow and Stack Exchange will be covered by the MIT License.

We’ve been working on this problem for a little while now. We’ve consulted with the OSI, enlisted the help of a real-life lawyer, and discussed it exhaustively internally. We’ve come up with a solution that we think is a major improvement upon the status quo.

The new license terms, in brief:

Starting February 1, 2016, contributions across the network will be licensed to the public under the following terms:

• Non-code contributions will continue to be available for use under the terms of CC-BY-SA
• Code contributions will be available for use under the terms of the MIT License
• You don’t have to include the full MIT License in your code base. Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder (or Stack Exchange on behalf of the contributor). This optional exception to the MIT License will live in our terms of service.

That last bullet makes using Stack Exchange easy, and provides added protection to code contributors and users.

For the vast majority of developers, the above is Too Much Information. The new licensing terms don’t change anything. You can do everything you did before and maybe more when you visit Stack Overflow: copy code, tinker, fiddle, put it in your project, and keep building.

But to future-proof your work, we recommend you do one of these 2 things, or both:

• A) Add a comment to your code that links back to the post where you found it, or
• B) Comply with the MIT as it’s typically used, by including the full license text in your source

You’re doing option A already, right? This is just standard operating procedure when it comes to finding code on the internet – a hyperlink comment ensures you’ll be able to debug down the line. But under the new terms a hyperlink comment is more than just pragmatic, it’s a hat-tip, and it’s a tit-for-tat that ensures you’ve complied with a contributor’s terms.

We want to know what you think about the terms described above. Before you let us know, a few anticipated questions answered in brief:

Is it really that simple?

It’s pretty simple. We’re optimizing for ease of compliance and clarity. This scheme lets you be compliant even if you don’t do a thing. You just have to do a thing – provide credit – when and if the original poster asks for it.

My project is Open Source, can't I just include the MIT License?

Yes. Taking advantage of the notice preservation exception is completely optional. When the new terms launch, we'll have easy to follow guidelines in the help center on how to be compliant for a variety of use cases.

What about code contributed before February 1, 2016?

This is just a first step in alleviating licensing ambiguity for users of Stack Overflow and other Stack Exchange sites. Code that was contributed prior to February 1, 2016 will be available for use as it has always been, under the terms of CC-BY-SA. We are looking into ways we might allow users to opt-in old code contributions to the new scheme.

What about other sites in the Stack Exchange network?

These terms will go into effect for all code posted after Feb. 1 on all sites in the Stack Exchange network.

Who came up with this scheme?

You can blame or optionally thank Tim Post, Britton Payne and Sam Brand for this. They also had an enormous amount of help from the Open Source Initiative.

What’s next?

We hope to roll this out February 1, 2016. We know it’s short notice, but we think the proposed terms are a decisive improvement over status quo, and so a change probably can’t come early enough. Please let us know what you think.

• Thank you so much. <3 – Jeremy Dec 16 '15 at 17:56
• How does this work for edits of existing code post 1st Jan? Does there exist a halfway state where part of a code block is under one license and the other part another? – Flexo Dec 16 '15 at 18:02
• How are we defining code? If I write "code" but dont put it int a code block, is it counted as code? Also, what about things like math blocks on the Math.SE site? Im guessing that would go under CC-By-SA? (related meta post) – David says Reinstate Monica Dec 16 '15 at 18:08
• Crap, crap, crap. This is not even "what do you think of changing the license", this is a "we will change the license". This is not your work, you have no right to decide this. Shame on you. – Uphill Luge Dec 16 '15 at 18:11
• @HansPassant Code contributed before this is exempt: "Code that was contributed prior to January 1, 2016 will be available for use as it has always been, under the terms of CC-BY-SA" – Undo Dec 16 '15 at 18:12
• You say you want to know what we think, but it will go into effect Jan 1 regardless. I support this change but am offended at your pretense of caring what we think. – Jeffrey Bosboom Dec 16 '15 at 18:15
• @JeffreyBosboom If we were going to "just do it" we would have, and then announced it. The whole point of this post is to get feedback before we do it. Coulda probably been worded to make that clearer, good point there. – Tim Post Dec 16 '15 at 18:19
• I don't like how attribution isn't required for code. I tend to choose CC-BY for content I post elsewhere on the Internet (where I have a choice) and Apache 2.0 is my go-to software license. Both require attribution. True MIT requires attribution by way of the license (it requires the license, including the copyright line, to be included in a project that uses it). Effectively, text that I write on SO requires attribution, but anyone can use my code...dislike that. – Thomas Owens Dec 16 '15 at 18:26
• If you take the MIT License and waive the copyright notice requirement, what's left? Isn't that essentially public domain with a disclaimer of liability? – 200_success Dec 16 '15 at 18:31
• I think it's ludicrous that this is something people spend time on, what happened with common sense or public domain? If I ask you a question in the street and a passer by hears the answer I don't care. Posting stuff on stackoverflow, it being text, code or whatever is basically the same as shouting it from the rooftops - how can it be anything other than public domain/licence-free? – Christoffer Bubach Dec 16 '15 at 18:33
• @samthebrand What was the rationale for getting rid of requiring attribution? – NathanOliver Dec 16 '15 at 18:36
• @ChristofferBubach: Ah yes, the old "it's on the web, therefore it's public domain" nonsense. Please, no. That's not supported by any legal theory I'm aware of, and for rather good reason. – Nathan Tuggy Dec 16 '15 at 18:44
• @samthebrand So we just reward them by getting rod of the requirement? That does not seem right to me. – NathanOliver Dec 16 '15 at 18:55
• What happens when someone posts code they don't own the copyright to (for example, to explain a bug in third-party code their answer works around)? If the user attributes to the SO post, there's a chance of figuring out what happened (IANAL but "good faith" may now apply, for whatever that's worth); with no attribution it looks like the code was just copied. (Also, while you're working on the license, it might help to clarify the poster's obligations when quoting third-party code.) – Jeffrey Bosboom Dec 16 '15 at 19:35
• So, public domain as a thing doesn't actually exist everywhere, @ruffin - this is one of the problems that licenses like CC-0 have tried to attack. But beyond that, it's really not cool to tell people that merely by posting here they're giving up authorship of what they wrote. Presumably if you're posting on Stack Exchange you want others to benefit from what you've written... But that doesn't mean you want them passing it off as their own work! No one should have to make that trade-off. – Shog9 Dec 16 '15 at 20:28

In essence, this proposal is to move from a copyleft license (CC-BY-SA 3.0) to a permissive license for code. (By default, it's basically the most permissive license possible, nearly equivalent to public domain with a liability disclaimer.)

Having thought about it for a couple of hours, I've shifted my opinion from "I'm not sure" to "Please reconsider — this is truly awful." (Sorry to sound dramatic, but @Laura suggests that that's what it will take.)

I suppose that the rationale for the change is to protect users of Stack Overflow answers from (hopefully hypothetical) copyright trolls whose modus operandi is:

1. Post code in a Stack Overflow answer
2. Wait for the code to be incorporated into some software project
3. Sue or extort
4. Win or settle
5. Profit!

To preempt that low-probability, high-stakes terroristic threat, we're being faced with a proposal that imposes huge costs on all Stack Exchange communities.

## Wrong attitude

When I contribute an answer on Stack Exchange, I like to think that I am sharing knowledge, not giving away code, even if my answer happens to contain code. Also, we as a community expect questions to be more like "How should I …?" rather than "Can anyone gimme teh codez to do …?" The Creative Commons license expresses the knowledge-sharing attitude. The MIT License most certainly does not.

## MIT License: inappropriate for questions

When someone posts a question, whether to Stack Overflow, Code Review, WordPress, Raspberry Pi, or any other Stack Exchange site, I don't believe that there is any intention to donate that code to the public domain (technically not PD, but in practice indistinguishable).

For Code Review, in particular, the code being shared is usually substantial, often a complete runnable program. The intention is to share code for discussion, not to give code away. A permissive license that allows commercial exploitation without attribution could discourage a lot of questions. It could also encourage users to withhold parts of their code, hindering open discussion.

Sometimes questions are actually homework solutions. It would be helpful to have the attribution requirement as an additional legal tool to combat plagiarism, in addition to the usual moral/academic standards.

We want the Internet to take the knowledge and advice that they learn from answers to improve their code and their skills. We do not expect them to just take the code as a product.

If the answer is trivial (e.g. "Just use this library function that does exactly what you need"), then common sense says that there is no copyright licensing issue. You just learned something about the obvious way to accomplish something.

If the answer contains a substantial original contribution of ready-to-use code, then attribution should be required by default.

Let's take a hypothetical extreme example: someone publishes an O'Reilly-style cookbook consisting of code snippets extracted from Stack Overflow, Code Review, PPCG, …. Only the code blocks are taken; all of the surrounding text is reworded. No attribution is given. How would you feel about that?

License fragmentation breaks the remix culture that Creative Commons seeks to establish. With this proposal, we would have

• Pre-2016 contributions, which are CC-BY-SA
• Post-2016 code for which the poster elected to use the standard MIT license
• Post-2016 non-code contributions

Distinguishing what content falls under which license seems like a bit of a nightmare to me. And that's not even considering edits on top of existing posts, or questions that are loosely inspired by other posts (as often happens on Code Review).

In summary, please don't do this to us.

• I will want to thoroughly agree with this and point out that I do not want questions that I post to Code Review or answers that I post to Code Golf to be licensed with a permissive software license that allows inclusion of the contained code into other projects. – user213963 Dec 16 '15 at 21:28
• Thanks for this. While I don't agree 100% with your philosophy around sharing code on Stack Overflow and across the network, I value knowing that you and probably many others feel this way. We will carefully consider this feedback. Also, please feel free to start a related discussion on Code Review to let us know how that community specifically feels about these proposed changes. – samthebrand Dec 16 '15 at 21:37
• @samthebrand Code Review did have a post to discuss the license proposal. I migrated it here to be closed as a duplicate so that we can centralize the discussion. It is important that we decide on a uniform licensing policy throughout the Stack Exchange network to ensure the free flow of information and to allow migrations to work. Let's not build walled ghettoes. – 200_success Dec 16 '15 at 21:59
• @RubberDuck Like BilltheLizard, I view it as sharing knowledge, not sharing code, so I don't agree that using a license designed for code would be better. Furthermore, as other have pointed out here, the line between code and text is blurry (e.g. math and pseudocode). – 200_success Dec 16 '15 at 23:03
• Well, then I suppose we don't agree that a code license would be better. I guess I see the code I post for review as "feel free to use this if it helps" and a code license makes sense to me. – RubberDuck Dec 16 '15 at 23:05
• 200_success, this is a good summary of why this is a bad idea. I'd like to add, almost all my code is GPL 3. If stackexchange insists on making it mit licensed, the result would be that I would simply not post any GPL code on stackexchange. The purpose of these sites is to help with code, and I think the GPL is actually quite good about explaining what can and can't be or shouldn't be licensed, and shorter code blocks are one of those things. Other code is proprietary, but could be posted as an answer as a snippet. You can't magically change the licensing at will without repercussions. – Lizardx Dec 17 '15 at 1:53
• We want the Internet to take the knowledge and advice that they learn from answers to improve their code and their skills. We do not expect them to just take the code as a product. -- Well, OK, but doesn't that push Stack Overflow even further into "How do I fix my broken code" territory? The answers that are most useful to others are the ones that actually have complete, working code in them. Don't underestimate the educational value of that. Otherwise, we might as well go down the Math.SE path, and make every answer a HINT. – user102937 Dec 17 '15 at 2:17
• Well, none of what I said applies to Code Review, but the principles are the same. If I post code to any "question-answer" type venue, I expect anyone coming across it to use it for any purpose whatsoever. If I wanted my open-source contribution to be regulated specifically by some license, I'd put it on Github, not Stack Overflow or Code Review. – user102937 Dec 17 '15 at 2:31
• My first thoughts when reading this announcement were exactly the same so I'm glad that a highly respected user already wrote them up as a detailed answer. I'm a free software enthusiast. That's why I stand up for copyleft. When I decided to participate on SO, the fact that contributions are CC licensed was crucial for me to be convinced that this is the right thing to do. I'm posting code to build a repository for sharing free knowledge, not because I want to be a gratis code monkey for somebody who doesn't respect freedom and hence cannot be bothered complying with a copyleft license. – 5gon12eder Dec 17 '15 at 2:46
• 200_success, I had to think about your answer, and you have it nailed: the cc license embodies the sharing aspect, and the MIT is a 'taking' license. I can see why you went through the mental steps to arrive at your conclusion. The only entities who would care about having a taking license are corporations that are worried about being able to freely take, ie, their goal is not sharing, but free and clear access to taking code. This is hostile to the spirit of sharing. I contribute because others shared with me previously, here, and elsewhere. This is also why I do GPL code, sharing. – Lizardx Dec 17 '15 at 3:44
• @200_success Google was convicted of infringement for a 9-line function... – assylias Dec 17 '15 at 9:53
• For Code Review, in particular, the code being shared is usually substantial, often a complete runnable program. The intention is to share code for discussion, not to give code away. Hmm, I actually never thought of that way and it's an excellent point. – B.K. Dec 17 '15 at 17:15
• "common sense says that there is no copyright licensing issue" - the one big issue I see in this answer is that lawyers who try to abuse copyright to extort money never go by what common sense says, but by what is, in the most remote of interpretations, feasible. Judges are a different story, but actually fighting over a case in court is a significant investment that must be avoided at all cost in the first place, so relying on common sense sounds problematic. – O. R. Mapper Dec 18 '15 at 12:34
• If we don't want to give our code as the MIT, we can always make a screenshot of our code and embed that, as it is an image then. – Ferrybig Dec 18 '15 at 13:03
• @MichaelT: Your code is already permitted to be used in other projects - I'm not sure why you think this changes anything about that particular issue. The only difference between these two licenses, effectively, is attribution. You could not before, and cannot now, control distribution. – Nick Bastin Dec 20 '15 at 17:13

I live on the Open Source site. Now, if someone came along and asked a question along the lines of "is it ever a good idea to add an exception to the requirements of an existing license" (and, lo and behold, someone has now asked that question), I'd tell them it's not - for these reasons:

1. You're essentially creating a crayon license.
If you modify the terms of an existing license, you create what is known as a crayon license. Those are a problem - see "How can a “crayon” license be a problem?" for the reasons why.
2. It's far too easy to claim an illegal use is legal.
See this answer of mine. Essentially, someone can get my code from somewhere I use it - perhaps in a commercial open-source product of mine - and not attribute it to me. When I chase them down on that, they can simply claim "oh, I got it from Stack Overflow", and get away scot-free.
3. It's massively unclear how to reverse that requirement.
Say I don't want to have this extra exception applied to any of my code. How do I note that? If I put a note in my user profile that all my code snippets must be attributed properly as per the terms of the full MIT, is that enough? Do I have to add a note to every answer? I'd rather not have to do that, but I also don't want to be chasing people down endlessly for misusing my code.

Make it easy to opt my code out of this exception, or don't do it.

• "It's massively unclear how to reverse that requirement." It's not unclear in the slightest. You do it in the same was as you opt-out of the current license agreement: you don't. This is a great rationalization and simplification of the licensing environment on Stack Overflow, and allowing exceptions would undermine that. – Jeremy Dec 16 '15 at 18:57
• @JeremyBanks The post clearly says "This optional exception to the MIT License will live in our terms of service" (emphasis mine), so yes, you can opt-out. – Jeffrey Bosboom Dec 16 '15 at 19:00
• @JeffreyBosboom You're misunderstanding. The optionality of applying the new clause falls on the licensee/consumer at time of use -- because they may prefer to exclusively use the standard MIT terms for consistency. The licensor/author does not have the option to opt-out of this clause in general (at the Stack Overflow account level), just to directly request that specific projects add attribution. – Jeremy Dec 16 '15 at 19:04
• @JeremyBanks Okay. What about the "as long as users give reasonable attribution upon request of the copyright holder" part? Can I request it of all users by stating so in my post, or do I need to track down each user individually? – Jeffrey Bosboom Dec 16 '15 at 19:07
• @JeffreyBosboom That's definitely worth clarifying, and Enderland brought it up in his post. My opinion is that polluting user's posts with licensing noise would be a bad idea, and they should be required to track down projects individually. This is the most legally pragmatic approach to the reality of the situation. Most users will be using the code without proper attribution, and this provides a framework for accepting that use while still allowing the author to demand attribution. – Jeremy Dec 16 '15 at 19:11
• Yep, MIT with attribution only on request -- when the "repo" (SO) of MIT licensed code does nothing to notify the copyright holder of the reuse -- is for all practical purposes to put the code in the public domain. Either explicitly say that we're public domain-ing this stuff with a giant USE AT YOUR OWN RISK sign, or honestly copyleft code as @ǝpoɔɟoʇɹɐ requests. (I'm partial to the former.) – ruffin Dec 16 '15 at 20:22
• The whole idea of a licence is that it tells you what you can do. "You can use this without attribution unless and until the author or SE says otherwise" is just asking for trouble. If you've used the code in a released product, what do you do then? If the answer is, "to be safe, attribute in the first place", then the "option" is just a misleading "feature" encouraging people to get themselves into trouble. This makes no sense at all to me. Why would you do this other than to store up trouble? – cfr Dec 17 '15 at 0:37
• @samthebrand I know I'm somewhat engaging in the duel you weren't hoping for (surprise! I'm another OS moderator) but the way I'm seeing this MIT + exception business is that we're putting this into the public domain. You're letting anyone take it, use it without a proper license file, and at their discretion. The only thing that we preserve is our moral rights, which in many jurisdictions, is required and irrevocable by law. The problem with this attribution framework is that there may be no communication, and people will be negligent in their due diligence to attribute code 'at request.' – Zizouz212 Dec 17 '15 at 2:07
• TL;DR This is basically public domain with moral rights preserved, particularly for the jurisdictions that allow people to relinquish those rights – Zizouz212 Dec 17 '15 at 2:08
• No, just no. Code posted on SE has always been intended for people to just use with little to no strings attached. If you're not happy with that, then you shouldn't be posting code on SE, regardless of what licensing terms are officially in use. The only thing this change does is bring the official licensing terms in line with how people actually use the site. Anyone who posts code on SE with the intention of chasing down people who use that code and telling them "you have to give me attribution" or "you can't use my code like that" is basically trolling. – aroth Dec 17 '15 at 3:38
• @samthebrand My problem is not the MIT license; my problem is the optional exception. (a) because it makes a crayon license, (b) because the "attribution by request" part hasn't been sufficiently explained, as I've noted in this post. If I want someone to use the full MIT attribution (i.e. copyright notice and license), how do I do that? Or can I not do that, and only ask for that "reasonable" attribution? I'd like to see either the former, or no exception to the license. – ArtOfCode Dec 17 '15 at 8:56
• @aroth People may think that they're posting code on SE intending for it to be used with no strings attached, but they're doing so out of ignorance. Those who know and care about the current CC BY-SA licensing don't want attribution to become optional. – curiousdannii Dec 18 '15 at 5:20
• @aroth: No, they don't. The proposed changes give the consumer of the copy the option to include the MIT license (including attribution) or not. They give no options to the author, you must accept the new ToS or stop contributing. – Ben Voigt Dec 20 '15 at 1:12
• You can have a permissive license or a copyleft licence, and either way people know where they stand. If you say "permissive unless I request otherwise later" then no one will know whether it's safe to use your code, and you'll have the worst of both worlds. – trichoplax Dec 20 '15 at 20:07
• @JGallardo It's perfectly reasonable to want to be attributed for the work you've done, no matter how big it is or what effort went into it. – ArtOfCode Dec 21 '15 at 18:45

# What?!

Am I the only person that doesn't understand what this all means? This really needs a TL;DR.

I was under the impression that any answers I provided on Stack Overflow that contained code are to be used freely, otherwise why would we post the code?

What I want answered is What do I need to do as someone who wants my answers to be used freely? Nothing?

• Depends what you mean by "free". If you mean no requirements at all, put a note in your profile saying you put your code into the public domain (or CC0 where public domain doesn't exist). – ArtOfCode Dec 16 '15 at 19:13
• @ǝpoɔɟoʇɹɐ Can't do that, it's part of the terms of the site when you sign up, you use their license. – Raystafarian Dec 16 '15 at 19:14
• @Raystafarian But you can dual-license your own content. You can't revoke the CC BY-SA license, but you can grant an additional license. – ArtOfCode Dec 16 '15 at 19:19
• @Raystafarian The contributor is still the copyright holder and can choose to offer their code under additional licenses or release it into the public domain; the user then has a choice of which license to use the code under. – Jeffrey Bosboom Dec 16 '15 at 19:19
• You can only use existing code on SO under the terms of CC-BY-SA, which is rather problematic. – CodesInChaos Dec 16 '15 at 19:54
• As far as I understand this, the TL;DR here is: you are free to copy any code you see posted in Stack Overflow and do whatever you want with it. From January 2016, the author of the post having the code has the right to ask you to add a comment with link to the post on Stack Overflow. Would love to stand corrected. – Shadow Wizard is Vaccinating Dec 16 '15 at 20:19
• @ShadowWizard: No, you are not currently "free to copy any code you see posted in Stack Overflow and do whatever you want with it." All posts on SO, including any code within them, are licensed under the Creative Commons Attribution-ShareAlike 3.0 license (a "viral" license similar to the GNU GPL), and you must comply with its terms if you redistribute any code from SO. [...] – Ilmari Karonen Dec 16 '15 at 20:28
• [...] Of course, that's assuming that the author of the code hasn't granted you some other, additional license to use it; for example, I have a statement in my user profile releasing all my (original) code on SO under the CC0 public domain dedication, unless otherwise noted, so when using my code, you can choose to rely on that instead of having to comply with the standard CC license. – Ilmari Karonen Dec 16 '15 at 20:28
• @IlmariKaronen thanks, I was basing my assumption on "You can do everything you did before and maybe more when you visit Stack Overflow: copy code, tinker, fiddle, put it in your project, and keep building", posted by Sam. So this sentence is not true and/or accurate? – Shadow Wizard is Vaccinating Dec 16 '15 at 20:33
• @ShadowWizard: Technically, no, unless either: a) your project is licensed under CC-By-SA, and you properly attribute the code to its original author; b) you've received permission to use the code under some other license terms; c) the code you're copying is trivial or unoriginal enough to be ineligible for copyright protection (the threshold is fuzzy and varies by jurisdiction); or d) nobody cares enough to sue you. – Ilmari Karonen Dec 16 '15 at 20:39
• @TinyGiant - If by "plagiarize" you mean "use", then yes. But if you were worried about plagiarism of your code and intent upon delivering repercussions unto anyone caught plagiarizing it, why post it on SE in the first place? The outrage some people are expressing over the attribution issue makes no sense. Does SE exist to help solve problems, or to inject attributed code snippets into random codebases? – aroth Dec 17 '15 at 4:42
• @ShadowWizard "you must comply with its terms if you redistribute any code from SO" - Small correction; any code or any derivative works involving any code from SO. Such as compiled applications and binaries, for example. – aroth Dec 18 '15 at 5:39
• It seems to me that if I answer a person's question using a block of code, I expect that person to use my code in their project. Period. Whether they attribute the code to me or not is a matter of legal minutiae. – Isaac Lyman Dec 18 '15 at 16:41
• @aroth it's not all about code getting copied intro code bases somewhere. I've had answers that have had techniques that seem to be novel and have been subsequently mentioned in academic publications. I don't care as much about what code bases those end up in, but I would like attribution when those appear in papers or books. – Joshua Taylor Dec 19 '15 at 4:27
• I wish they added a TLDR to this post, as well. I am not well-versed in licenses, especially since I mainly work with closed-source software. I am worried that people will misinterpret these changes, without a layman's terms guide, leading to issues with SE. People may not post as often, if ever again, on sites like Code Review. – onebree Dec 21 '15 at 14:40

A few thoughts:

# 1. Don't pretend this is the MIT license

Don't pretend you're using the MIT license when you're not. If you need a unique license for a unique situation then just use a unique license. While crayon licenses in general are a problem, I think that this the Stack Exchange network is a situation where a new ultra-basic license would be warranted. And I know you'll use your legal team to prevent the problems with other crayon licenses.

# 2. It would be best to make a new license

If the purpose of this change is to make it easy for post authors and easy for those who would use the code in those posts, then what you're doing won't help. I think it would probably be best to write a new license which is very basic and allows reuse as long as a URL of the post is attached to the borrowed code. If you want to have any user choices, then it should be between this and the existing CC BY-SA. It would also be possible to give users the option to do a CC0 type opt-in too, but the default must be attribution.

# 3. The license needs to be self contained.

You can't have the license, and then list exceptions to it in the terms of service, and then also require users to check a poster's profile to see whether the exception hasn't been opted out of. If you want to have two options, then just have two completely distinct licenses. Users also need to be able to see easily what the license of each post is...

# 4. Each post should show its applicable licenses

Each post should indicate below it what the relevant licenses are. If the user has selected only CC BY-SA or CC0 then it could show it. Old posts would show only CC BY-SA (unless perhaps their author edits them and ticks a box saying "update to the new SE-Attribution license"). Posts edited by multiple authors would show only the compatible licenses: new posts without any user opt-ins would be the same as if they only had one author, but if the user did opt-in to CC BY-SA only, then the posts would be only CC BY-SA.

It is against the terms of the CC BY-SA license to require specific attribution formats. It is dishonest and disingenuous to keep that link in the footer.

• I completely agree on your points 1-4, but I don't think that link in the footer is wrong. Yes, imposing additional "requirements" is a bit dubious, but I think it is important to highlight "attribution required" and provide a link to what we expect reasonable attribution to look like, for those who don't understand what it means and how important it is. – Bergi Dec 18 '15 at 11:00
• @Bergi Giving suggestions for how to attribute is fine, but the CC BY-SA license just doesn't allow you to demand attribution in any particular format. – curiousdannii Dec 18 '15 at 11:03
• Perfect answer, summary of all the necessary points IMHO. – Nemo Dec 20 '15 at 18:14
• I agree that SO needs to be more transparent in the licenses that apply to each question/answer. – onebree Dec 21 '15 at 14:29
• This is just what I was hoping to see, an option to filter out non public code. I want to see only public code, and anything I post will be public. – Andrew Backer Jan 15 '16 at 3:33

I have two thoughts about this. The first is that the line between code and non-code is sometimes blurry. This means that depending on how we write answers, different things are protected differently. That seems odd. The second is that the change in license should probably be accompanied by a reminder about the community standards for plagiarism: just because the code is licensed permissively doesn't mean that it's OK to copy within Stack Overflow.

## Where's the line between code and non-code?

I know that we discourage code-only answers, but there are cases when they're appropriate: namely, when the code is well commented and self-documenting. Some languages have documentation strings, comment block conventions, etc., to support this. Suppose I write an implementation of an algorithm for a Stack Overflow question. In order to make the implementation idiomatic, I include a nice description in a documentation string in the code. According to this change, the description is now MIT licensed, whereas exactly the same prose description would have been CC-BY-SA licensed if I had written it outside of the code block. This seems very, very, odd. What happens if I write some "code", but don't put it in a code block? Maybe I put it in the answer text, but in boldface because I don't need monospacing. Which license is it under? E.g., if someone asks how we can convert a number into a list of its digits, I can post this as a code only answer (that, I think, doesn't have the typical issues characteristic of code-only answers):

(defun digits (n &optional (base 10))
"Returns a list of the digits of N when written in a specified the
specified BASE.  The digits can be extracted from least significant to
most significant by repeated division.  When N is divided by BASE, the
remainder is the least significant digit of N.  The quotient is then
taken as the new value of N, and the process is repeated until N
reaches 0.  Note that in the case that N is zero, DIGITS returns the
empty list, rather than a list containing 0."
(do ((digits '() (list* r digits))
(n n)
(r 0))
((zerop n) digits)
(multiple-value-setq (n r) (truncate n base))))


Now, if I posted it like this, I'd get attribution requirements for the explanation:

Such a function returns a list of the digits of N when written in a specified the specified base. The digits can be extracted from least significant to most significant by repeated division. When N is divided by base, the remainder is the least significant digit of N. The quotient is then taken as the new value of N, and the process is repeated until N reaches 0. Note that in the case that N is zero, the function returns the empty list, rather than a list containing 0.

(defun digits (n &optional (base 10))
(do ((digits '() (list* r digits))
(n n)
(r 0))
((zerop n) digits)
(multiple-value-setq (n r) (truncate n base))))


This seems odd, especially for languages with strong documentation traditions.

But one of the comments from a mod seems to indicate that even the "code block ≡ code" rule (which I just made up; I don't see any actual guidelines for determining what's code and what isn't in the announcement) isn't really fixed either (emphasis added):

Just to clarify, we never said code is anything inside a code block. It might be up to a user to decide what's code and what isn't, just like he/she may have to make a judgement about whether something crosses the threshold of originality. Ultimately, always, it's on a code user to decide how he/she wants to use what they find here.
samthebrand♦ 12 hours ago

I think there must be some misunderstanding here, because it seems like this would make the official policy: "You posts are licensed under CC-BY-SA, except for the code portions, which are under a MIT license with the attribution requirement removed, and it's up to the discretion of the people who use your posts to determine which parts are code." That can't be the intent, can it?

I think this would get especially blurry with any questions about Markdown or HTML, where the answer "text" itself might also count as the code. E.g., if someone asks "How do I make text bold in Markdown?" to which someone replies "Like this (see source)." The same issues could come up with TeX/LaTeX, since some sites support MathJax.

That's obviously a contrived example, but it highlights that we need some clear guidelines about how to determine which parts of a post are code, and thereby licensed under the MIT license (and whether the author requests attribution), and which parts are non-code and thereby licensed under CC-BY-SA.

(One more edge case that's probably not really important comes to mind: if we do, as some users are suggesting, or at least asking about, decide that edits should no longer turn text into code blocks, or vice versa, what happens with all the posts that (mistakenly) use code blocks instead of blockquotes, or that use backticks instead of quotation marks?)

## Remind users that attribution is still required within Stack Overflow

I had some concerns that the more permissive licensing of code would make it much easier for a badly-behaved user to attempt to justify code plagiarism. After all, if they can copy it without attribution outside of Stack Overflow, why not within Stack Overflow, too? Shog9 pointed out that this is actually covered in the Help Center, How to reference material written by others. You can look through the edit history for some earlier thoughts before that clarification.

• This is a great catch. I should quick copy/paste it as another answer here for the upvotes! – enderland Dec 16 '15 at 20:26
• @enderland And all you might have to do is wrap it in a code block and comments... – Joshua Taylor Dec 16 '15 at 20:31
• Plagiarism is orthogonal to licensing. Plagiarism is frowned upon on Stack Overflow (and other sites) because it is seen as hostile by the community, not because it violates a license. Nothing being discussed here changes that; if you get caught using someone else's work on Stack Overflow without attribution, you're gonna have a bad time regardless of what license applied to the original. Heck, ripping off someone's public domain code you found on pastebin is just as bad as ripping off someone's licensed code; morally, you're just abusing their generosity for your own selfish gains. – Shog9 Dec 16 '15 at 20:44
• @Shog9 But what's the problem in this case? If you lift code from someone else's answer, attribution is no longer required, right? So is there any meaningful way to flag it? Copy and paste code without attribution would be within the license permission, wouldn't it? I agree that it's still just as bad, but what community guideline would it run afoul of? Someone who copies and pastes could easily say "I'm just using code according to the license." – Joshua Taylor Dec 16 '15 at 20:50
• @JoshuaTaylor You're still pretending that some code is your own work when it was actually written by someone else. That is plagiarism, even if the code is in public domain. Shakespeare is entirely in the public domain now, that doesn't mean that people will just accept it if you pretend you wrote Macbeth. – Mad Scientist Dec 16 '15 at 20:52
• @MadScientist: So if not providing attribution is pretending that you wrote it (plagiarism), then what does not requiring attribution really do? – Diminutive Colossus Dec 16 '15 at 20:55
• @MadScientist Yes, I understand what plagiarism is. My point is that there's not really a good way to flag it now. It seems strange to say to users that "code you post can be copied and used by others without attribution" but to then punish other users who do exactly that. It's like we're saying "Hey everyone, come use this code that you can find on Stack Overflow. BUT, you'd better not use it on Stack Overflow, because that's against the rules." – Joshua Taylor Dec 16 '15 at 20:56
• It's spelled out in the help center on every site, @JoshuaTaylor. Which in turn was motivated by this discussion here on meta (and, let's face it, a huge number of flags and complaints over the years). Doesn't matter who you're ripping off or what license their work fell under, if you get caught doing it here you're gonna face the music. – Shog9 Dec 16 '15 at 21:04
• @Samthebrand it's up to the user of the code, not the author? So if anyone can come along and use anything from our posts by calling it code, is there anything left that's still necessarily covered under cc by sa? This seems like it would make the whole site mit licensed... that can't really be the intent, can it? – Joshua Taylor Dec 17 '15 at 1:11
• @Shog9 Plagiarism is the "wrongful appropriation" and "stealing and publication" of another author's "language, thoughts, ideas, or expressions" and the representation of them as one's own original work. - It is not plagiarism if you give the person permission to represent the code as their own work. If I tell someone "you don't have to say that "rolfl" wrote that code", then it's no longer "wrongful appropriation". You cannot say "there's no need to attribute code", and "you have to attribute code" (and keep a straight face). – rolfl Dec 17 '15 at 3:54
• The blurry line is a good point and raises a question: if the formatting changes the license of (parts of) an answer, does that mean that non-authors can no longer change the formatting of a post – since they don't have the copyright to relicense? – otus Dec 17 '15 at 9:02
• To pile on, what about pseudo code, our weapon of choice on Computer Science? Which license applies? Does the answer change when the code compiles in any language (maybe by accident, the author may not even realize that)? (cc @Shog9) – Raphael Dec 17 '15 at 9:26
• @Raphael The comment that samthebrand (a mod) left says that "it's on a code user to decide how he/she wants to use what they find here." So it sounds like anyone could come along and say "this is pseudo code, which I'll count as code, so I don't need to provide attribution." Now combine that with the idea that someone mentioned to create an "O'Reilly style cookbook" from code taken without attribution from Stack Overflow, and you've got a situation that I bet lots of contributors won't be happy with. – Joshua Taylor Dec 17 '15 at 13:31
• @rolfl: Take your claim of "It is not plagiarism if you give the person permission to represent the code as their own work" over to academics.SE and see how long it survives. It absolutely is plagiarism to represent someone else's work as your own, and having their permission may free you from having them taking any action against you for the plagiarism, but it does not stop it being plagiarism, and it does not stop other parties from taking action against you. – Ben Voigt Dec 18 '15 at 4:57
• @Shog9 Well, you tell me. That's basically working, copy-pastable code for some languages, modulo some syntax details. I'd say it's pseudo code. So, if you copy-paste that into your project, make minor adjustments so the compiler likes it -- which license applies? – Raphael Dec 19 '15 at 11:28

Sorry but I think this is a pretty terrible idea.

Code on Stack Overflow, Server Fault, etc. isn't "code" in the typical sense of licensing where you're concerned about distributing it for use by others. It is an example of one way (but not the only way) in which a particular problem presented in the question can be solved.
It is more akin to code snippets in a textbook than a software project on github.

CC-BY-SA is (IMHO) the most appropriate license for code posted to a Stack Exchange site: We're licensing the documentation (including snippets/examples) to you. If you happen to cut-and-paste bits of it into your production environment that's fine - my understanding has always been that you should attribute it the same way you would if you posted it to another site (by a URL pointing to the source) and you're good to go.

We (contributors) are not providing any kind of warranty or statement of suitability for a particular purpose with our code snippets, or any other part of our answers. If you want to go ahead and make language to that effect prominent in the terms of service by all means do so, but I don't think muddying up the license terms for site content makes sense!

That said, if you feel we must have a separate license for "code" posted to the site taking an existing license with specific requirements and saying in your terms of service "…but it's OK to ignore requirements X, Y, and Z" is REALLY TERRIBLE -- you're creating two legal instruments (Terms of Service for the site and a License for Use/Distribution of the code posted therein) with conflicting requirements - this is the kind of stuff lawyers charge hundreds of dollars an hour to bloviate about in front of judges.

artofcode already spoke about the dangers of "Crayon Licenses", and I think those points are well made, so I won't reiterate their points here.
Suffice it to say I think you should either find a license without a notice preservation/license reproduction requirement, create one without that requirement (dear \$_DEITY, another freakin' Open Source License! Kill me now!), or craft one specifically for Stack Exchange code snippets that describes precisely what attribution is necessary (e.g. a link to the page you got the code from) and what notice preservation is required, if any.

• This answer doesn't consider sites like Code Review, where whole, working, real live solutions are routinely published. – RubberDuck Dec 16 '15 at 22:49
• @RubberDuck I would think the same principle applies: The question posted (code under review - full working solutions as it were) is part of a larger exercise in documenting/analyzing/critiquing the features and flaws of that code. By posting it your users are allowing others to take it (in whole or in part, with or without modifications) under the CC-BY-SA license terms ("Attribute it appropriately and you're fine"). There is however some fuzz around what constitutes appropriate attribution in a complied product (as just one example) which could stand clarification. – voretaq7 Dec 16 '15 at 22:57
• I will say that Code Review (or other sites where a "full working solution" is a major part of the question or answer, like maybe Code Golf) are an interesting challenge here. Code Review in particular may involve large portions of projects under their own licenses, which may conflict with all or part of the MIT license being proposed here. That however is a legal quagmire I do not want to wade into. There is no License Tequila in my office. – voretaq7 Dec 16 '15 at 23:07
• if you wrote the code, then it's not much of a quagmire. You have the right to license as you please. It's when it's not your code that it gets sticky. – RubberDuck Dec 16 '15 at 23:48
• @RubberDuck Very few large projects (like "operating system scale") are exclusively the work of one person - what part of code you originated which was then modified by someone else and refactored by a third person is "yours" in the sense of the right to dictate licensing? Also worth noting that some projects assume copyright on code contributed to them as part of their conditions of contribution (and pretty much every corporate job does, as it's "work for hire"). And now we're waist-deep in legal mud and I STILL have no License Tequila! – voretaq7 Dec 16 '15 at 23:54
• @voretaq7 Did you overlook the SA part of CC-BY-SA? – CodesInChaos Dec 16 '15 at 23:59
• @CodesInChaos No, nor did I at any time claim that CC-BY-SA was completely without flaws in this regard: The same issues emerge in either case when someone posts content they don't wholly own (though saying "The code is MIT licensed" if it was C&P from a GPL'd project adds a new layer of legal horror to deal with). Frankly I just don't think that split-licensing (especially split-licensing with a ToS that says it's OK to ignore parts of one of the licenses) would be an improvement here: It adds complexity and creates new problems, while not alleviating any of the existing ones. – voretaq7 Dec 17 '15 at 0:17
• @CodesInChaos your point does lead into what probably prompted Stack Overflow to start thinking about this though: "Does including a code snippet (in whole or in part with or without modification) invoke the Share Alike requirement and mean you have to distribute the resulting product under CC-BY-SA?" -- As I alluded to in my answer I see the license covering the content as "documentation with examples" (and I'm not in the habit of wholesale C&P Coding), but I can see lawyers bristling over it. (I think there's an alligator swimming in our quagmire now.) – voretaq7 Dec 17 '15 at 0:26
• @voretaq7, re "by a URL pointing to the source"; Where? Within the source code that no one has access to? Or at the website's about page? – Pacerier Aug 24 '20 at 7:09

I'm not sure that this would be a good move for Code Review, as questions and answers there often involve substantial amounts of code that are intended to be public knowledge, but not necessarily freely incorporated into other projects' code bases — especially for private commercial gain.

I haven't thought through what the ideal compromise is, but I think that this non-trivial change should be reframed more as a question for discussion than a proposal for ratification.

• We normally do like to have more discussion when implementing decent-sized changes, but in the case of licensing, Sam and the rest of the team (both within and outside SO) have put an enormous amount of work over literally years into investigating alternatives. It would be unreasonable for us to ask the community to do that kind of work to have an exhaustive discussion of all possibilities, so we did most of the heavy lifting and are coming to you with the best solution that doesn't make SO hard to use, protects user contributions, and that we as a company believe fits our philosophy. – Laura Dec 16 '15 at 18:53
• @Laura Does that mean that it's a fait accompli? – 200_success Dec 16 '15 at 18:54
• No. If there's something truly awful about this proposal that we somehow overlooked, we'll reconsider. But saying "here's what we'd like to move forward with; what do you think?" is a far better option than "out of all the possible licenses out there, which one's your favorite?" (in my opinion). – Laura Dec 16 '15 at 18:55
• @Laura: I fail to see how removing all requirement of attribution "protects user contributions". Do you mean that it protects user contributions from the users contributing? – Diminutive Colossus Dec 16 '15 at 19:02
• @Morwenn It's not that simple. We remix code as encouraged by Creative Commons. Answers inspire new questions (see the rags-to-riches tag on Code Review). Answers often contain excerpts from the question, plus some original contribution. – 200_success Dec 16 '15 at 21:26
• Are you genuinely positing the premise that code posted to Code Review is "for educational purposes only, not intended to be used in production code," and that there is any practical manner whatsoever that could ever enforce such a principle? – user102937 Dec 17 '15 at 2:25
• @RobertHarvey If I post a question to CR, I have no expectation that it should become virtually public domain. (Whether I'd actually follow through and sue someone for stealing the code without attribution, I don't know, but enforcement is a separate issue.) If I post an answer on CR, my motivation is to help the asker learn, and if it also educates other Internet users, that's great. If the answer happens to contain a substantial amount of original code, the intention is to have them study the code, not to feed them the code. – 200_success Dec 17 '15 at 2:41
• It doesn't seem to me like you can just brush-off the issue of enforceability. I understand what you're saying as a matter of principle, but without enforcement, that's all it is: a principle, one without teeth. – user102937 Dec 17 '15 at 2:45
• @RobertHarvey If you believe that it's all unenforceable anyway, then we might as well stick with the simplest solution that works: CC-BY-SA for everything, the status quo. – 200_success Dec 17 '15 at 3:52
• Why should it be less enforceable than code in open source repositories? There are questions about whether it would be worth enforcing and that might differ. But it is no less enforceable. – cfr Dec 20 '15 at 3:33

Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder

Sounds like a recipe for boilerplate

# I hereby explicitly request attribution under the MIT license
# for this code, as stipulated in Stack Overflow TOS § NN ¶ n.


popping up in half the code blocks on the site. I think we can all agree that this is noise.

It may also be legal noise; I have no idea if it counts, honestly, but I want attribution for my code. I also have no way to track who takes it from the site, so what else do you want me to do?

• I've seen people do this already; usually not for trivial amounts of code though. I guess formalizing it ain't awful; if it becomes pervasive, that's reason enough to build a UI for it. – Shog9 Dec 16 '15 at 20:35
• This is a good point Josh (OP). I agree comments like that smell like noise and we need to reconsider the way we explain the license to discourage them. Rounding up with the lawyers on this one. – samthebrand Dec 16 '15 at 20:42
• @samthebrand, your comment makes it sound like you just need to explain the license differently, not actually change the license, in order to "discourage [such comments]". Does that mean that code users can't use code without attribution regardless of attribution being explicitly requested or not? Why would you "discourage" comments requesting attribution unless attribution is legally required by default? And if attribution is legally required by default, then what is the exception to the MIT license about? – Wildcard Dec 17 '15 at 0:53
• @samthebrand When you say you want to "discourage" these comments, it sounds like you're just hoping we will acquiesce to the waiver even if we have the right to require attribution. – Jeffrey Bosboom Dec 17 '15 at 1:46
• @samthebrand A blanket exception to attribution requirements would probably make me add comments like that to all my answers. I love sharing my knowledge, but sometimes answers take hours(or days) of self-education and research before an answer can be given. Attribution is the least I can ask for as recognition for my contributions. Sure, Shog's suggestion of adding a UI for it makes it easier to put back what was taken away, but I don't think that makes the noise no longer noise. – Booga Roo Dec 17 '15 at 4:06
• @Josh, would you mind if copy that boilerplate into my own future answers? I will of course add full attribution to this post when I do it: # Original attribution request taken from Josh Caswell at http://meta.stackexchange.com/a/271105/188823 – Richard Le Mesurier Dec 17 '15 at 10:24
• Heh, @RichardLeMesurier. You and anyone else who reads this comment may use it under the terms of the CC0 license. – jscs Dec 17 '15 at 19:29
• @Josh imagine that header now taking over all code snippets on our site :) – Richard Le Mesurier Dec 17 '15 at 20:54
• What if we reduced legal noise by letting people choose a license and displaying their choice clearly? – Anko Dec 18 '15 at 17:11
• Also, what happens when someone edits a post to remove that comment? – rutter Dec 18 '15 at 18:12
• "I also have no way to track who takes it from the site" - In other words, no matter what the license says on paper, it's effectively unenforceable anyways. All the more reason to simplify the 'on paper' version. – aroth Dec 20 '15 at 1:55
• As I read it users will not be ALLOWED to require attribution through anything they do here. The choice will be between not posting code here and accepting the waiver. The only thing you'll be able to do is to track down any project which uses your code, after it uses it, and retrospectively request attribution. If that's right, I would expect people who care to cease posting code here. It might be worth exploring other options. Code could be posted elsewhere and a link provided in the answer. I can see a lot of link-based answers, maybe an image of the code. Sound useful? Well.... – cfr Dec 20 '15 at 3:29
• @Deduplicator It need not be a link-only post. The explanation can be here. Only the code needs to be elsewhere. – cfr Dec 27 '15 at 17:56

You don’t have to include the full MIT License in your code base. Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder (or Stack Overflow on behalf of the contributor). This optional exception to the MIT License will live in our terms of service.

How will this be allowed/enforced/implemented on Stack Exchange itself? For example, if I add a disclaimer to every post I make saying I require it - will this be allowed?

What if I modify my user profile to include an indication of this? Is this equivalent?

If most regular users require attribution how is this an improvement to the status quo?

Non-code contributions will continue to be available for use under the terms of CC-BY-SA

Code contributions will be available for use under the terms of the MIT License

This might be pedantic but... what is considered "code" for this?

If I write an answer that talks about code, is it a mess of licenses? Where parts of sentences are CC-BY-SA and parts are MIT? What about pseudo code?

• How is it enforced? The same way all copyright is enforced. By lawsuit. – Kaz Dec 16 '15 at 18:42
• @Zak I think that by "enforced", enderland is asking what labelling conventions we should use to distinguish between CC and MIT portions of the content. – 200_success Dec 16 '15 at 18:51
• Even worse, some math is so close to code that it's confusing which it would count as. Don't believe me? Look at Lambda Calculus. Is that non-code or code? It used in math papers, but can also be compiled into programs. (The answer is it depends on how you use it.) – PyRulez Dec 16 '15 at 21:18
• Markdown can help to some extent here. Almost every code posted by an experienced user is indented by four spaces and easily processed by markdown. Thus, post content identified as code by the markdown is MIT (whenever this thing gets implemented). – Prahlad Yeri Dec 17 '15 at 4:24
• @PrahladYeri: So if I post it without the four spaces because I don't want it under the new licence and someone changes it to a code block. What then? Will that be forbidden in the future to avoid such things? – Burkhard Dec 17 '15 at 8:15
• @PyRulez You might also want to start asking "which type of code is covered?" Here's an interesting issue: on the TeX site, people post lots of TeX/LaTeX as code, to answer people's questions about that language. On other sites that support MathJax, TeX/LaTeX code is used within answers to show formulas, etc. It's probably not a huge issue, but an interesting corner case. If you ask the question, "how do I typeset XXX" on TeX.se, the answer should be code, but on another site, the answer could be something like ".... (see source)". – Joshua Taylor Dec 17 '15 at 13:36
• How would adding your attribution preferences to your profile be helpful? I almost never look at the profiles of people when reading questions/answers. I'm usually too busy trying to solve problems I'm having. – Ellesedil Dec 17 '15 at 20:14
• On TeX SE it is not uncommon for people to include explanatory explanation in the source of the code they post such that typesetting the source outputs a document which includes the explanatory comments. So all of it is indented by 4 spaces. – cfr Dec 20 '15 at 3:22

I have sent an inquiry directly to the OSI for a comment on this situation. Frankly, I am surprised that they would be recommending the changes that are proposed here. I hope to hear back from them shortly.

On the other hand, I would like to know more about what parts of this recommendation are suggested, or endorsed by the OSI? When you say "you consulted with them", does that mean "you spoke with them and they think it is a great idea?" Does it mean "We spoke to the OSI, they think it Sucks, but, hey, 'we consulted them'!"

Does the OSI have any statement regarding what they feel is relevant from a objective perspective?

• I have not yet received a response from their "contact us" page. Hmmm. Anybody else contact them? – rolfl Dec 24 '15 at 14:34
• @rofl Any news? I'll contact them as well. – Tim Jan 14 '16 at 17:42
• @Tim - I have heard nothing. I contacted them using their "contact us - general enquiries" – rolfl Jan 14 '16 at 18:55

## Please make it clear that code will be dual-licensed, not just pure MIT.

At least, that's what I hope you're trying to do, but the way you've phrased it, it could be interpreted to mean that new code posted to SO after this ToS change will no longer be licensed under the CC-By-SA license, but only under the MIT license.

Such an interpretation could mean that people currently reproducing content from SO under CC-By-SA, e.g. on a programming blog, would now have to change their licensing terms if the content they used included any code posted after this change. The option to just make everything CC-By-SA and not worry about any other possible requirements might no longer exist.

Also, arguably, this might put SO itself in breach of CC-By-SA. The "viral" ShareAlike clause of CC-By-SA requires that, when any CC-By-SA content is used in a combined work (that is not merely a collection of separate, independent works), the whole work must be released under CC-By-SA. While SO as a whole, or even a single Q&A thread, might count as a mere collection of separate posts, it's hard to argue that a single SO post containing both prose and code would not count as a single work that must be released under CC-By-SA, if any of it is.

(The original author is, of course, allowed to release their own work under any license terms they want, however self-contradictory they might be. But SO, as a redistributor, must abide by the license terms granted to it — and if those terms for prose are still just CC-By-SA, then arguably they must include CC-By-SA for all content, for SO to be allowed to distribute it.)

Also, off-hand, I kind of wonder just how compatible CC-By-SA and the MIT license actually are. As a permissible license, I'd assume that the MIT license does allow redistribution under CC-By-SA, provided that the requirements of the MIT license — i.e. including, unless waived, the copyright statement, license text and disclaimer — are followed. What I'm not 100% sure about is whether or not those requirements themselves, if not waived explicitly or via dual-licensing, might not fall foul of some language in CC-By-SA that forbids distributors of derived works from imposing additional restrictions on them. Honestly, it's been a while since I took a close look at those licenses, so I'm not sure; I'm just pointing this out as one more possible reason to prefer explicit dual-licensing.

• If something is dual licensed then the compatiblity of those licenses is irrelevant. You can dual (well multi) license something as GPL, MIT and a All-Rights-Reserved commercial license. – curiousdannii Dec 17 '15 at 1:17
• @curiousdannii: Exactly, that's why I brought up the issue as one more reason in favor of explicit dual-licensing. – Ilmari Karonen Dec 17 '15 at 1:21
• Until now I have used the dual licensing approach (CC-By-SA + GPL) for complete or nearly so programs, though omitting this for code fragments that are small (relative to comments outlining the GPL license grant). I'm not as familiar with the MIT license as I would like to be to offer full throated agreement to the proposed policy change. In my mind MIT = BSD + attribution requirement. – hardmath Dec 17 '15 at 3:32
• Your answer is intriguing, but, to me, what I really am confused about, is who in the OSI actually helped with this. My respect for them is diminished. – rolfl Dec 17 '15 at 3:57
• @curiousdannii: Compatibility isn't irrelevant. Any forks of the content will carry only one of the licenses. – Ben Voigt Dec 20 '15 at 1:15
• Yes, dual-licensing the code is best. However! MIT isn't copyleft, so I doubt there would be issues incorporating MIT works into CC-BY-SA works. The only real requirement MIT has is mentioning the copyright holder, which is satisfied even by CC-BY; reproducing the license itself is often done simply by naming it in a ode header... The derivative, CC-BY-SA work is a separate thing and can be under its own license. That said, it would be useful to first get Creative Commons to say that MIT is compatible with CC-BY-SA (one way, of course)... except, what SE proposes isn't even MIT. – Nemo Dec 20 '15 at 18:19
• Interesting answer which seems...wrong. You say "make clear that they mean dual licensing" - when every way I read their post, they are saying it will explicitly be not dual licensed. I don't think they should make it's dual-licensing clear unless they change their minds to decide they want to dual license.. – Jimmy Hoffa Dec 21 '15 at 13:30
• @JimmyHoffa: I do wish to give SO the benefit of the doubt, and assume that they simply phrased the proposal poorly. As I note above, not actually making all content available under a single license (or, especially, not requiring contributors to give SO the right to distribute everything under a single license) would seem a... rather badly thought out choice. – Ilmari Karonen Dec 21 '15 at 14:19
• @IlmariKaronen it's really not a "benefit of the doubt" situation though. It's stated quite clearly. I would encourage you to elaborate on why the single license distribution is a "badly thought out choice" in your answer so you can clarify why you suggest dual licensing over single licensing (since dual licensing is a recommendation you're making in a somewhat backwards way - and absolutely nobody else is fronting the idea) – Jimmy Hoffa Dec 21 '15 at 14:24
• @JimmyHoffa perhaps you and I are reading a different post, but Ilmari's answer has 3 out of 5 paragraphs on why dual-licensing is better for SE, SE posters and reusers. – Nemo Dec 22 '15 at 15:28
• @Nemo, You didn't catch AP's point. If the prose is viral, and the code is dual-licensed, then their combination cannot be MIT, Therefore Stackoverflow needs to publish an additional page (with the submitter's permission) without the bundling. – Pacerier Aug 24 '20 at 7:21
• @Pacerier I think I did; I'm saying there are ways to distribute things under cc-by-sa. What do you mean by "their combination"? There are differences between a collection of works and a derivative work, for instance. – Nemo Aug 28 '20 at 7:42

That you wouldn't in your right mind derive from that particular code in your own program isn't the point. It's that having a code excerpt put on StackOverflow is not an instant carte blanche on that code's license.

Others mentioned that regarding Code Review...someone wanting to get feedback on their GPL project may not want to see their code relicensed MIT just because they put up a page or two of a routine. If it was important enough to bother framing up and asking for community feedback about, it may be something they specifically don't want to see adapted and made closed-source somewhere proprietary.

Beyond that...an attribution line in the source and a link to the StackOverflow answer that provided it isn't just good for "following the license", it's good documentation. SE URLs to questions and answers can be shortened down to just the stem, so http://meta.stackexchange.com/q/271080 instead of http://meta.stackexchange.com/questions/271080/the-mit-license-clarity-on-using-code-on-stack-overflow-and-across-the-stack-e?cb=1. Someone can not only see the reasoning behind why code is the way it is, they can go check up at a later date and find new information or raise new critiques of whether that's the real answer.

I have two competing feelings overall:

• feeling one: If you're the sort of person who has to worry so much about licensing and lawsuits, and have to make sure there's not one bit of GPL'd code in your project (or whatever)...it should be your culture of development that pays the tax on fretting about it. Stallman was Right, FSF/EFF 4eva.

• feeling two: I don't want to answer emails asking if someone can use code I post here, because if I wrote it and posted it inside an answer on this site, I don't care and they can do whatever they want with it.

So I don't really know how that translates into an answer, other than to agree with those saying this is probably not something that should be done unilaterally and on a quick timescale. It may need a more adaptive solution, like a process of pinging a post for a license audit...then on an as-needed basis various factors are gone over.

(e.g. I might in my profile tick the "anything by me is ok for being MIT licensed", and then all that would have to happen would be someone would look and make sure I didn't source the material from elsewhere, and perhaps it could be 'vetted' for license even if I'm not on the site anymore.)

• Note that FSF recommend not using the term 'MIT Licence' since it is ambiguous. SE are further compounding that ambiguity by creating yet another variant on top of whichever of the other MIT Licences they began with. One assumes that SE did not consult FSF on this. There are similar issues with the LPPL as you mention with GPL. Posting code here cannot provide carte blanche if it is derived from LPPL code. That makes it a derivative work and there are specific requirements which apply in that case. – cfr Dec 20 '15 at 3:42

I haven't read all the answers here, so this is probably a repeat. But given that you're only giving us two weeks to react, I'll say my piece anyway.

This is far too rushed. You may have been working for a long time, but

1. Your proposal is clearly not ready yet. You don't have a clear picture of how it would work.
2. Two weeks (including what is a holiday period for a large part of your audience) is ridiculously short time for feedback.

PLEASE DO NOT CHANGE ANYTHING ON JANUARY 1ST 2016. Even February 1st seems far too close. I'm not fond of the status quo, I think we must do something about it, your proposal is certainly something, but it is not the right thing.

Your proposal is a huge change, since it would allow code posted on Stack Exchange to be used anywhere with no restriction whatsoever. Please do not call this “MIT license”. The MIT license is about as permissive as it gets, but it does require one thing: to maintain attribution. Removing the attribution requirement should more properly be called putting the code in the public domain.

Your proposal is legally dubious. Some jurisdictions, including the one I live in (France), grant the author of a work moral rights, which for the most part (especially in the case of software) are limited to the right to attribution. These moral rights cannot be waived by contract. Does the fact that Stack Exchange operate under US law mean that if you waive attribution requirements in the terms of service, this applies to French contributors to? I don't know — you'd better clarify that with your lawyers, otherwise this puts users of code posted on Stack Exchange by French contributors at risk.

Given the impact of the change, you really should first consult, and then inform, all the users on Stack Exchange. For consultation, meta is the right place — but not just this meta. In addition to MSE, you should consult sites where code is routinely posted, and whose denizens don't frequent MSE much. Keep in mind that Stack Overflow is not the whole Stack Exchange network. You should consult communities that have different code posting patterns such as Code Golf, Code Review, Mathematica, TeX & LaTeX, Unix & Linux, …. To inform users of a change of such magnitude, meta is not enough; it's a change of the terms of service, and must be communicated to users before it takes effect.

You have not managed to present the change in a non-contradictory way. Do not change anything until you can explain the change. You claim

we will be licensing all new code contributions to Stack Overflow and Stack Exchange under the MIT License.

But then you go on to say

Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder

Give attribution upon request? That's… crazy. How would I know that someone is using my code, in order to make such a request? How would I contact them?

Oh, and by the way, since I don't know where this is heading, I hereby request that attribution be given in any creative work derived from my contributions on Stack Exchange. This includes both past and future contributions. This includes contributions in the form of executable code. This does not include contributions that do not meet the minimum threshold of originality to be considered copyrightable.

But to future-proof your work, we recommend you do one of these 2 things, or both:

A) Add a comment to your code that links back to the post where you found it, or
B) Comply with the MIT as it’s typically used, by including the full license text in your source

Wait: “to future-proof”? Proof against what? Against a contributor making an attribution request? That opens a huge maintenance cost. What on earth could possibly be the benefit of introducing such an uncertainty? Pick a license and stick to it. Make it a dual license if you think it's best, but don't make it something that can change later.

Sorry, you really need to go back to the drawing board.

• The update on the top of the original post says that they're postponing it until Feb 1st. – Cullub Dec 17 '15 at 19:18
• This post appears on the "Featured on Meta" sidebar on every site. – 200_success Dec 17 '15 at 19:24
• @200_success a.k.a. the box nobody reads. And anyway I wasn't referring to the announcement, but to the consultation. A post on MSE is not the way to get feedback from people who have better to do than care about the other 150 or so sites but have something to say about their community. – Gilles 'SO- stop being evil' Dec 17 '15 at 19:29
• I upvoted, but I really want to strengthen that: I could not possibly agree more, with everything you write here. I also wonder what will happen in case a contributor claims to have been unaware of this change, given that they are not making much of an effort to publicize it and certainly cannot decide such a thing unilaterally. But, I think the fact that the terms are so ill-defined matters little to StackExchange, so long as they aren't responsible for the unintended consequences. – Oleksandr R. Dec 20 '15 at 16:27
• Is there a 'we may change the ToS at any time by...' in the existing ToS? If not, the only way would be to force all users to agree to the new ToS on first visiting the site after 1st Feb. Even if there is such a clause, it would be dubious to rely on it, legally, if you were a company wanting to use code. At least, I imagine it would be, though I'm not a lawyer. And it might depend on where you are and.... If I were a lawyer, I imagine that I would advise extreme caution if I were advising a company about code use after 1st Feb. I cannot imagine the situation will be legally clear anywhere. – cfr Dec 26 '15 at 0:21
• @cfr “Stack Exchange reserves the right, at its discretion, to modify these Terms of Service at any time by posting revised Terms of Service on the Network and by providing notice via e-mail, where possible, or on the Network.” I presume that sending an email to every user would meet these requirements, although it isn't completely clear since having a valid email address is not required. It would be safer with an additional notice that you'd have to click through before posting or editing. – Gilles 'SO- stop being evil' Dec 26 '15 at 16:42
• @Gilles If I was a lawyer, I'd still feel happier if users had to actively agree i.e. by clicking through a new notice, as you suggest. That statement reads as if 2 things are required (1) update ToS (2) either email (if possible) or notice on the network. But it isn't clear what would count as providing notice on the network except by a click-through-new-notice of the kind you suggest. And any hint of ambiguity will worry the lawyers. – cfr Dec 26 '15 at 16:54
• @cfr in many (most?) jurisdictions, a contract cannot be formed or changed unilaterally, and the parties have to have a consistent understanding of the terms and their interpretation in order for it to be construed as properly formed. In the USA, for example, Specht vs. Netscape found that "reasonable notice" of the licence terms has to be provided. On the other hand, click-through licences have usually been upheld. I think your suggestion is the only reasonable approach, although I doubt SE will bother with it. – Oleksandr R. Jan 7 '16 at 18:22

I think that the change is in general a good idea. I'm not a lawyer, and I assume most people that use Stack Overflow and other SE sites about programming aren't either. Licensing can get very complicated quickly, and removing ambiguity and fuzziness is a good idea. The Creative Commons licenses weren't meant for code, and that leaves some issues with how to follow them when reusing code from any Stack Exchange site.

But I don't think this change goes far enough, there is still enough potential confusion left when copying code, or especially when you're not copying directly, but also rewriting it. This confusion might be mostly caused by my lack of knowledge in this area, but I guess most programmers aren't experts in copyright law either.

In my completely irrelevant and non-lawyer opinion, a very large part of the code on Stack Overflow doesn't meet the threshold of originality required to be copyrighted. A lot of snippets are short examples on how to use a particular library function or language feature. There aren't many different ways to use the same API, so I don't think it makes sense that this could be subject to copyright. This is pretty much based on my opinion on how the law should work, not how it actually works, so I might be entirely wrong about the actual legal issue.

If I would copy and paste a reasonably large piece of code directly, the rules are pretty clear, I have to attribute it. But what if I just copy it, and then play around with the code until I understand it? It might look pretty different afterwards, it arguably is a derived work and I should attribute it. What if the code is simply a short example showing how to use a particular function, do I really have to attribute that? But what if I read the code, look up the documentation of the involved feature, and then use that knowledge to write something that looks pretty similar, but I don't attribute because I didn't actually copy it? There's probably a good reason why people do clean-room implementations of copyrighted code, but once I've seen an answer on SO I can't unsee it.

I think some of my arguments in the previous paragraphs are rather unreasonable, but the problem is that just going by common sense in the area of licensing doesn't seem to be a good idea. The only way to remove all ambiguity is to use a license that grants unrestriced rights without any requirements, or putting the code into public domain. I don't know how well it is legally tested, but something like the Creative Commons CC0 license might work for this purpose.

It it still not entirely clear to me how this attribution exception is supposed to work. So I suggest to get rid of it entirely and use the least restrictive license you can find and avoid the issue entirely.

• A really well considered post. Thank you for this. I'll have more to say on this proposal soon, but I look forward to reading any and all related comments. – samthebrand Dec 16 '15 at 20:32
• @samthebrand It really didn't feel well considered while writing it, it is more of a train of thoughts dumped into a post. But I think that the part that makes it a bit incoherent, the fact that I don't actually know what I'm talking about when it comes to legal issues in licensing, is an important aspect that applies to most users that actually copy or adapt code from SO. – Mad Scientist Dec 16 '15 at 20:35
• It's a welcome train of thought. We've been reading between the lines on this for so long that we've probably lost a little bit of the forest for the trees. – samthebrand Dec 16 '15 at 20:57
• +1 for mentioning CC0. Honestly, I don't really think forcing all new code on SO to be released under CC0 would be a good idea (even though I do so myself), but I do think it would surely be better than the proposed "MIT + exemption" hack. Actually, one possible option would be to just use CC-By for code; dropping the ShareAlike clause makes code reuse a lot simpler, while still requiring attribution, and CC-By just requires attribution to be given "in a reasonable manner", without any lengthy boilerplate text like the MIT license has. – Ilmari Karonen Dec 16 '15 at 21:30
• Regarding threshold of originality, what do you make of this 9-liner? – assylias Dec 17 '15 at 9:36
• None of the CC licences really works for code. In addition, after reading through it, I think CC-BY is actually a weak copyleft and nowhere as free as the absence of -SA makes people think it is. CC themselves ask people to not use CC0 at all for new works due to perceived problems with it, but have postposed fixing them in favour of bringing out CC-* version 4 licences. Public Domain is not a licence grant, and thus does not allow reuse by people e.g. from different countries, and cannot be granted by most EU citizens either. – mirabilos Dec 17 '15 at 10:43
• – Mad Scientist Dec 17 '15 at 10:57
• @MadScientist “speculation that we did not anticipate CC0 usage for software at the time is true” on CC withdrawl of CC0 from OSI process – mirabilos Dec 17 '15 at 11:04
• A link to the witdrawal request of CC0 from the OSI process that actually works (pointing to the internet archive): web.archive.org/web/20150906005825/https://lists.opensource.org/… - the problem with CC0 referred to in that context is the explicit non-waiving of patent rights. – Michael Karcher Dec 24 '15 at 9:38

How does this work with edits?

Say I have an answer containing code, written in 2015. In 2016, I edit part of the code. Is the part I didn't edit still CC BY-SA? Or does my edit implicitly indicate it's all under this MIT crayon license? How is this indicated to readers unfamiliar with the site?

• samthebrand addressed editing in a comment above, but not the "How is this indicated" question. – jscs Dec 16 '15 at 20:40
• Extending this question: what if I edit someone else's answer from 2015? Does that (or could it) trigger a license update? – thegrinner Dec 16 '15 at 21:52
• They shouldn't: copyright belongs to that of the original author (for more background: opensource.stackexchange.com/questions/1340/…) – Zizouz212 Dec 17 '15 at 1:19
• @Zizouz212 But that would mean that the portion of the code that is edited after Feb 1 wouldn't have the new licence applied, so you can just generally say that all code added to SO after Feb. 1 would have the new licence. Of course, the very idea of portions of a snippet having one licence and portions having another sounds like pure evil, but the alternatives don't sound great either. – Servy Dec 18 '15 at 17:03
• No, any edits to code after Feb 1st are legally not allowed to carry the new MIT license. @Servy – Zizouz212 Dec 18 '15 at 17:38
• @Zizouz212 Where is that stated? Does that apply if I edit an entirely new snippet into an answer from before Feb. 1 that didn't even have code in it before (and I'm the author)? – Servy Dec 18 '15 at 17:46
• Nope, because the snippet would belong to the post, which belongs to the original author. Just because something is edited means that it can't be relicenced. It's the same idea – Zizouz212 Dec 18 '15 at 18:52
• How have other sites driven by user contributions handled license changes in the past? I remember Wikipedia changed its license a few years ago, but I don't know the details. – gengkev Dec 20 '15 at 0:05
• @gengkev see meta.wikimedia.org/wiki/Licensing_update for the update. Note that it was possible only because 1) CC-BY-SA and GFDL are both copyleft and similarly restrictive, 2) FSF released a new version of the license on purpose! Also, dual licensing. – Nemo Dec 20 '15 at 18:26
• There is no doubt on the answer: CC-BY-SA is a stronger license than the MIT/SE crayon license, hence CC-BY-SA survives (or the new work is plagiarism and copyright violation). – Nemo Dec 20 '15 at 18:27
• hmm, so basically the only solution is for the license to depend on when the original post was submitted. but that's much better than having different licenses in the same post! – gengkev Dec 21 '15 at 2:48
• and from the link @Nemo posted, it looks like Wikipedia actually asked its users about the change before deciding it would happen. huh. – gengkev Dec 21 '15 at 2:49

I'm primarily concerned by the lack of attribution requirements.

Right now, all content on Stack Exchange is CC-BY-SA, which requires attribution. However, the proposed change to the source code license won't require attribution. The original post does say that the users of code must give "reasonable attribution upon request of the copyright holder". I'd like to see more information about how this will work. Specifically, I want to ensure that whenever people use any content that I created that they obtain from Stack Overflow, there is a requirement for attribution. I'm not clear how that will happen.

I'm also not convinced that "a comment to your code that links back to the post where you found it" is sufficient attribution, especially in a closed source project where users can't see the source and therefore won't see that my original work was used as part of the project.

I do understand that copyright has restrictions. For example, some things cannot be copyrighted. I understand that if I can't copyright the code sample, then there's no need to license it and anyone is free to use it. Mad Scientist's post here talks about threshold of originality. But for things that can be, I do want to ensure that attribution is required uniformly across content.

• Sounds your goal is pretty much the same as mine when I wrote the license comments for codereview.stackexchange.com/q/1695/2150 – Ben Voigt Dec 17 '15 at 16:06
• On the other hand I would like to be able to mark all the content in my answers as public domain/CC0/WTFPL/anything that allows everyone to use it for any purpose without attribution. – user31389 Dec 19 '15 at 18:37
• @user31389 My understanding is that you can, if you choose. You could also dual license under a more restrictive license, but the people who find the content can effectively choose either license. That's why I choose CC BY and Apache 2.0 for content I post on my site, which would allow anyone to use the content for any purpose, and if I repost my contributions to Stack Exchange there, people have the freedom to choose. – Thomas Owens Dec 19 '15 at 18:43
• @ThomasOwens Yes, but currently I have to mark everything manually as CC0 licensed. Or I can write that on my profile, but then people would need to visit it. It would be great if there was some generic mechanism to mark a piece of code as requiring (or not) attribution, preservation of a license text or something else. – user31389 Dec 19 '15 at 21:10
• @user31389 That could possibly work, though I'm not sure how it would be implemented. However, I find it unacceptable to have the terms state that attribution is not required for a portion of content, especially when attribution is required for the non-code content. My assertion is that all content posted on an SE site, if used elsewhere, should require attribution unless the author specifies otherwise. – Thomas Owens Dec 19 '15 at 21:37
• TEX SE has a question on Meta on which people who wish state any additional licences under which the code they post here is available. – cfr Dec 20 '15 at 3:47
• As I read it, it can't happen. That is, the idea is that you cannot demand attribution other than retrospectively for a particular usage by a particular individual or organisation.... – cfr Dec 26 '15 at 0:26

Does this potentially make answering pre-February 2016 questions illegal after that date?

If someone asks on January 31st:

I have this code, it doesn't work, how can I make it work?

then two days later, I might know the answer and just copy his code, change a few characters to make it work and post that as an answer. Except, that I am not allowed to. His code is licensed CC-BY-SA but by putting it in my answer, I would license it as MIT. I am not allowed to do that.

Is this correct, or am I missing something?

Of course to make it legal I can answer it like

In line 5, you have to change the 3rd 'a' at position 16 to 'b' and in line x...

But if it is that cumbersome to answer, I might just not.

• What if OP puts in his question "attribution required"? Then every answer has to use proper attribution. :) – Patrick Hofman Dec 18 '15 at 11:04
• @PatrickHofman That's the problem that Josef describes. Since the proposed modified MIT license does not require full attribution it would be imcompatible. Basically it may be possible that you are not allowed to use code from old answers in new answers. – Trilarion Dec 18 '15 at 20:43
• Yes, it would be illegal. That's why the Wikimedia licensing update in 2009 required FSF to update the GFDL license, a mass migration to GFDL 1.3 and then a retroactive dual licensing to CC-BY-SA. meta.wikimedia.org/wiki/Licensing_update – Nemo Dec 20 '15 at 18:34

If this happens, I think it needs to be very explicitly shown on each code block what license it falls under. Having multiple licenses co-existing and trying to determine which one a particular code block falls under by looking at the date will get messy fast (especially if people have to manually add boilerplate text to require attribution).

Users should be able to set their preferred license in their profile and new code-blocks that they write will automatically default to this license, but can be overridden if needed.

Old code blocks will default to the existing license but users can go back and edit to change the license going forward (and maybe provide a mass-update tool if people want to change the license for all their answers at once).

• What happens when someone creates or splits a code block in the process of editing a post? You're right that this split licensing is going to be a mess, and your suggested solution to help manage the complexity will really help highlight how messy it's going to be. – 200_success Dec 17 '15 at 0:25
• – Anko Dec 31 '15 at 9:06

## I don't get it.

Sorry, I fear this is exactly what you wanted to prevent, but I don't understand how to attribute any more.

You don’t have to include the full MIT License in your code base. Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder (or Stack Exchange on behalf of the contributor). This optional exception to the MIT License will live in our terms of service.

WTH does this mean? By shortly skimming over it, this sounds like I would not need to give any reasonable attribution whatsoever, until the contributor asks me to do so. This can't be right.
After reading it again, the "ignore" seems to refer only to the "License’s notice preservation", which is… wait… only the thing that follows the Copyright (c) … line. Right?

I fear that this is what will happen for most people. They read "You don’t have to include the <License stuff>…" and think "Ah good, no attribution required". This should not happen. So please be explicit in your licensing requirements, and state something like

You have to include the line

Copyright (c) 2015 [Bergi](https://stackoverflow.com/users/1048572/bergi) at http://meta.stackexchange.com/a/271299/183280, MIT-licensed


above the used code, and should (if possible) or must (if requested by the copyright holder) include the full terms of the MIT License below that.

always been a little ambiguous how CC-BY-SA covers code

No, most ambiguity is gone at this point. CC BY-SA 4.0 now one-way compatible with GPLv3

You are changing from a copyleft to a permissive license. A lot of people, including me, care that our contribution is "shared alike," (the sa in cc-by-sa).

https://opensource.com/law/13/1/which-open-source-software-license-should-i-use: "the choice of license reflects as much of the social contract that is being made for the project as any legal requirements" The the social contract should not be changed unilaterally like this.

Edit: after reflection, I'm mostly ok with the change because copyleft for small code examples is usually more effort than it's worth (gnu recommends against copyleft for small < 300 lines https://www.gnu.org/licenses/license-recommendations.en.html), but I still do not agree with how it was changed, and think the reasons I mentioned are still valid reasons for being against it.

• What about the whole lot of people who don't want their contributions to be copylefted? And the whole lot of people who just want to be able to use code without having to worry about what license terms apply to each snippet? It's the third group that dwarfs the other two. Do their wishes not count? You can both ask and answer on SO, which I think implies that the social contract includes "I'm going to help you without expecting anything in return, because one day maybe you'll do the same for me". – aroth Dec 17 '15 at 8:18
• I'm not exactly sure how to respond, but I'd like to point out that no one seemed to be clammering for cc-by instead of cc-by-sa, or starting an alternative site because the existing copyleft was too onerous. – Ian Kelling Dec 17 '15 at 8:36
• I'd posit that may have been because many people weren't aware and/or don't pay attention to these sort of things. Hell, until I saw this thread in the list of promoted subjects, I was positive that content on SO did use CC-BY. Most of the previous discussions I've stumbled across on the subject were focused on ensuring that the attribution component was handled correctly. I haven't personally seen a discussion where someone wanted to assert copyleft over a third-party codebase because of a snippet they'd authored on SO. – aroth Dec 17 '15 at 10:06
• Actually, it's not a unilateral change. It applies to new code contributions so, if you don't agree, don't post. If you do post, that's acceptance of the "contract" on your part, hence bilateral. It's really that simple :-) – user14860 Dec 17 '15 at 13:07
• Just to be clear: Stack Exchange currently uses CC-BY-SA 3.0, not 4.0. – 200_success Dec 17 '15 at 17:32
• Can anyone carefully explain why CC-BY-SA 3.0 is copyleft because I don't think it is. Here's the full text of the license: creativecommons.org/licenses/by-sa/3.0/legalcode It seems to me that when you are copying code snippets from StackOverflow, that you are adding those snippets to a Collection, from the point of view of the license. So that means that the copied snippet is still covered by CC-BY-SA 3.0, but the rest of your code is not. – Ron Dec 17 '15 at 19:31
• @200_success: If we are talking about adaptations (which is probably the common case if using code snippets posted here), CC BY-SA 3.0 and 4.0 are compatible licenses (one-way). So if adapting code posted on Stack Overflow today, you can license your adaptation under CC BY-SA 4.0 and/or under GPLv3. – unor Dec 17 '15 at 21:34
• @aroth: On SO/SE we have a copyleft license since the beginning. Someone who wants to license their contribution under a permissive license could and can do so with dual-licensing. If we would change to a permissive license, users that want a copyleft license can’t do so (well, they could dual-license, but that of course doesn’t offer the desired protection). -- I’m interested how many users know about the licensing, but even if there are "many" that don’t know/understand/care about copyleft, there are for sure also many that do. – unor Dec 17 '15 at 21:53
• @paxdiablo: "My way or the highway" is unilateral, in the same way that "buy a diamond from De Beers, or not at all" is a monopoly. (Yes, I know De Beers is only about 65% of a monopoly.) – Nathan Tuggy Dec 17 '15 at 22:47
• @unor "If we would change to a permissive license, users that want a copyleft license can’t do so" - I don't fully agree. Users that want a copyleft license on their snippet can still have it, so long as they don't embed the snippet directly in their answer. So for instance, create a github project, set it up with the GPL (or CC-BY-SA, or whatever), put your snippets there, and then link to them from your answers. I think it's fair for the onus to be on the people who want a more restrictive license in terms of setting up a structure that enforces their desired code-snippet license terms. – aroth Dec 17 '15 at 23:28
• @aroth "Users that want a copyleft license on their snippet can still have it, so long as they don't embed the snippet directly in their answer" Which means their answer depends on external content, and thus is not acceptable. And no, first publishing as GPL and then as public domain doesn't mean the second publishing action is in any way gimped. – Deduplicator Dec 19 '15 at 21:33
• @aroth: "Obviously copying a GPL'ed code snippet into an answer would not have the effect of removing the GPL from that snippet" Actually, the proposed Stack Overflow terms of service would do exactly that. If you are the copyright holder, you've just dual-licensed. If you are not, you violated Stack Overflow terms of service (and this latter statement is true already). – Ben Voigt Dec 20 '15 at 1:26
• @aroth, each of your significant claims in this thread has been debunked already. I'll add: you ask, "What about [1] the ... people who don't want their contributions to be copylefted?" Those people don't need a license change: they are already catered for. "[2] people who just want to be able to use code without having to worry about what license terms apply..." Those people are plagiarists at heart. – user136089 Jan 4 '16 at 0:21
• @aroth, you ask, "Why should authoring [something] give you an entitlement to dictate license terms to anyone else?" Whether you like it or not, that's typically the law, and I'm not going to debate legal philosophy in this comment. As has already been pointed out to you several times, if you personally prefer to (dual-)license your own works under MIT or CC0, etc, you can! You are in no way disadvantaged here. Lastly, "common sense" is completely subjective. By appealing to it in your argument, you have committed a logical fallacy, so your argument is inherently logically unsound. Sorry. – user136089 Jan 4 '16 at 6:21
• @aroth For clarity: by "a third party", I don't mean the contributor or Stack Exchange, Inc.. Those are the 1st & 2nd parties. I mean parties who have an arbitrary business requirement to distribute code contributions from Stack Exchange sites, that they didn't write, in proprietary non-SaaS software. (Which is a pretty sketchy business requirement!) – user136089 Jan 5 '16 at 1:54

I agree that requiring the inclusion of the full MIT license for a small snippet of code from SO is unreasonable, but I feel entirely waiving attribution is also unreasonable, and directly against the principles of user-contributed content SO was founded on.

I propose that attribution continue to require a link to the SO post where the code originated and the name of the poster, in the same way that CC-BY-SA attribution works now. In open-source code the standard "link in a comment" practice you recommend should suffice. Commercial code will add the link in the usual "disclaimers and licenses from third-party code" spot; they might choose to include the full license anyway to keep things simple for their lawyers.

(I think this is basically using CC-BY for code instead of CC-BY-SA for prose, but I am not a lawyer.)

• Yeah, what I think you're saying is that it should be either A or B and that there should be no option C where a user doesn't include attribution? – David Mulder Dec 16 '15 at 19:28
• While I agree with you in principle, this is not how OSS licencing works (others have pointed out the problem with crayon licences already). It’s better for all parties (poster, SO/SE, user) to use an established licence, despite the boilerplate (and, c’mon, it’s under 1 KiB). – mirabilos Dec 17 '15 at 10:44
• @mirabilos CC-BY is an established license, and its text allows attribution to be given "in a reasonable manner". If the laywers like the rest of it, I think the flexibility is valuable. – Jeffrey Bosboom Dec 17 '15 at 17:33
• The only issues with CC-By that I can think of are that a) it's not specifically designed for code (but it's no worse than CC-By-SA in this respect), and b) despite being a permissive license, it still contains an anti-DRM clause that some might find objectionable or problematic (although, again, CC-By-SA has that too). Other than that, I do like the suggestion. – Ilmari Karonen Dec 19 '15 at 1:27
• If I'm reading you correctly, henceforth code is available only under the MIT license (or your modified version thereof), not the CC BY-SA license. Why not retain the existing license, and add the MIT license? This would make life a lot easier for people copying posts from here. It's much easier to copy an article if the whole thing is under one license.

This condition is met when a > 3.

Is that "code"? Is most of that sentece CC BY-SA, but those final characters MIT? Is this not a mess?

• If I edit someone's post to format their code properly, am I changing their license terms? Do I have legal permission to do that?

• Bullet point number 2 was also one of the first comments, and to my mind really needs to be addressed. I just came back here to post about it. – jscs Dec 16 '15 at 21:15
• And "define 'code'" is now its own question. – jscs Dec 16 '15 at 22:18
• Does it matter whether a>3 is code? It's not copyrightable either way. – MSalters - reinstate Monica Dec 17 '15 at 0:02
• It matters a little bit, @MSalters, because the entire post is copyrightable, so depending on the location of the "trivial" line, it's unclear whether you're dealing with one or two licenses. – jscs Dec 17 '15 at 0:06
• Is <3 code too? (Say it is!) – tripleee Dec 18 '15 at 8:26
• I <3 your comment, @tripleee. – TRiG Dec 18 '15 at 10:09
• +1: "In order to determine which license applies when reusing this text, first solve this intractable problem"... – trichoplax Dec 22 '15 at 12:01

Here's my two main points:

Once posts become licensed under different licenses, how will we know which license is used by a particular post?

• Will there be an icon next to your flair at the bottom of the post which indicates the license?
• Will code blocks be colour coded based on license?
• Will a footer be added to every code block stating the license?

Whatever approach is used, it needs to be clear and understandable to everyone, even those who haven't used SO before.

### How can I make it clear that I still want my code to be attributed?

Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder (emphasis mine)

I may request to have all my code attributed. How can I make this clear to those who use my code?

@Josh Caswell stated that you can probably use something along these lines in your code blocks:

// I hereby explicitly request attribution under the MIT license
// for this code, as stipulated in Stack Overflow TOS § NN ¶ n.


Is there a way this can be implemented into the UI (i.e a checkbox which adds a notice to the bottom of the post or a preference in your settings which automatically does so to all posts) or will we just have to do this ourselves?

• Seems that all your existing posts continue to require attribution and share-alike, since they continue to be governed by CC BY-SA. Only new stuff will use the new license. So we at least don't need to worry about noise edits pushing old code to the front page. – Ben Voigt Dec 18 '15 at 5:04
• @BenVoigt Good point- I forgot that existing posts would not need to be edited. – angussidney Dec 18 '15 at 6:05
• I would like to clarify that I wasn't intending to recommend "that you can probably use something along these lines in your code blocks", but just that I foresee that happening. To me, this tidbit is noise, as I said in my answer. – jscs Dec 25 '15 at 2:08

If people are using code I've written on SO, but are not publishing the MIT license with attribution... What's to stop me or someone else from suing them proclaiming they didn't receive a copy under the MIT licensed form published on SO? They are using unlicensed versions of my code at that point...

I have a hard time believing I won't have a leg to stand on in court exerting my IP rights when they've no indication of licensure for said code of mine.

The MIT license I extend to SO is given to them but I still maintain personal IP rights to productize said code and sell it to others holding them to separate licenses than that which SO and people who receive the code on SO are given. Per SO's TOS I am still the right-holder, they are merely provided a license by me upon my submission.

Honestly, I think the whole MIT licensure thing is a perfectly good idea. I think that "you don't need to publish the license upon your usage of the code" exception cannot function reasonably, and if utilized opens loopholes in the whole concept of licensing the code to begin with.

• If you post code on SO, and you also sell that code to someone else under another license, they are free to use the license you sold them or the license they get from taking it from SO. Relatively clear. You could get them to sign a contract requiring them to not use any other licensed version of the code you licensed them for-pay if you where really worried about that. – Yakk Dec 16 '15 at 20:16
• @Yakk I'm not worried; I'm merely trying to point out possible holes which not requiring people to publicize a license may create. When folks go around using code without putting a clear license on it, I just see this as walking into a large legal gray area that is a bad idea. I would encourage no one to use code they received by an MIT license and not include the MIT license - this "optionally include the license" provision they're adding encourages people to do that. – Jimmy Hoffa Dec 16 '15 at 20:20

Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder (or Stack Exchange on behalf of the contributor).

There are two fairly obvious problems with this:

1. It's not always possible to add attribution later when requested by the copyright holder. E.g. if someone makes a paper book which teaches a subject using code taken from various posts, and then the authors of some of those posts request attribution, the best that the publisher can do is to pulp the unsold copies and put an erratum on their website.

2. About half of the MIT licence is a disclaimer of liability. Replacing the notice preservation requirement with "attribution" means not needing to state that the author and copyright holder has disclaimed liability. If you're saying, in effect, that half or more of the licence you've chosen is irrelevant and unnecessary, why on Earth did you choose that licence?

• Additionally, not requiring the disclaimer to be retained is a bad feature of e.g. the ISC licence, which has been commented on in the Open Source community (OSI mailing lists, and others) several times (OpenBSD still uses the unfixed version). – mirabilos Dec 17 '15 at 11:27
• Upvoted mostly for point 2. Couldn't we get the same (or better) effect by using CC0, and putting the liability disclaimer in the SO TOS? This seems like trying to drive a screw with a hammer. – T.E.D. Dec 17 '15 at 15:29

If you don't want people to use your code snippets, why did you post them to Stack Overflow?

Reality: The purpose of the CC-BY-SA licence is to stop link-farmers ripping off the content to auto-generate a vast Internet of Crap. It's not to make sure you get a mention in the comments in Contoso's internal web portal because you knew the correct way to deserialize a widget.

The new licence should be that the code snippets in answers are public domain, or at any rate are licensed with the only obligation not to hold the author liable, and no other obligations.

If you have some code you want to protect with copyright, it's not appropriate to post it to Stack Overflow.

• Unfortunately "code fragments are public domain" is not legally recognized language in the USA and many of the countries adhering to the various WIPO treaties. The best you can do is explicitly lay out every right you grant in a license, which is why we have a plethora of licenses, and why the OSI is working doggedly on trying to bring order to the whole situation. I wish it were simple, but it's not and never will be. Choosing the MIT while making attribution optional is probably the closest they can get to public domain from a legal perspective. It's not a bad move. – Pollyanna Dec 16 '15 at 20:02
• @AdamDavis that's complete crap. They could write their own licence which was the same as MIT but with no attribution requirement rather than an optional one. – Ben Dec 16 '15 at 22:44
• By the time you posted this answer, the question had already been migrated from meta.SO to meta.SE because it affects far more sites than just SO. I can't think of any code snippets I've posted to SO which I'd be worried about people reusing without attribution, but I definitely want to preserve my moral rights under the Berne convention with respect to some of the code I've written on other sites in the network. – Peter Taylor Dec 17 '15 at 16:39
• @PeterTaylor, for example? – Ben Dec 17 '15 at 16:43
• Example 1, example 2 (which is also an example of code which can't be put in a code block), example 3, example 4 – Peter Taylor Dec 17 '15 at 16:52
• @PeterTaylor, you've persuaded me that it shouldn't apply to Code Golf. Not Stack Overflow, or DBA, or ServerFault or poweruser. – Ben Dec 17 '15 at 16:57
• +1, I can't believe how many people want attribution for their code snippets. Guys, isn't it sufficient to get rewarded with public reputation in exchange for your time/free contributions? – Erwin Mayer Dec 18 '15 at 5:22
• "The purpose of the CC-BY-SA licence is to stop link-farmers ripping off the content to auto-generate a vast Internet of Crap". Totally wrong: Stack Exhange doesn't hold the copyright and cannot use copyright in any way against competitors. – Nemo Dec 20 '15 at 18:32
• @Nemo To add to your point, the proposed license change would of course make it less likely that anyone (even the original author / copyright holder) could legally restrain scrapers/spinners. E.g. if an answer contained only code, it would be fair game for scrapers. In short, the proposed change means that SO/SE's competitors would have more freedom to scrape, not less. – user136089 Jan 4 '16 at 0:26

## Reasoning

I don’t think this is a good idea.

### Background

I’m a BSD developer myself, so I’m normally happy with putting things under BSD/MIT-style licences, but there are two big things that go against BSD spirit there:

## The exception from reproducing the licence ☹

This is really bad, as attribution is all a BSD developer usually gets (and, occasionally, patches to the eMail INBOX). It also creates a “net” licence by itself, the problems with which others have already pointed out.

So, if you’re going to switch to MIT, use MIT, not MIT with some exception.

## What is code?

I’m a very big fan of putting everything under the same licence, be it code, data, documentation, etc. so I cannot help but disagree with distinguishing between “Non-code contributions” and “Code contributions”. In addition, someone has to decide what is what, and that usually falls to judges, and we all know things just go down the drain when lawyers are involved.

## This means:

All three bullet-points you stated are against the spirit of those who use MIT-style licences in the wild the most.

## Other problems

Some people have pointed out that e.g. “the GNU libc doesn’t become MIT because I traced through it on SO”. This is true, you obviously can only licence content where you have the permission to do so. However, including such information on SO posts is still necessary; this is just as true currently though, so there needs to be an amendmend to the ToS that it’s fine to post content one does not own as long as it’s under an OSS licence. As things currently stand, HostileFork admitted what’s basically violation of the ToS by posting content where he doesn’t have permission to post it under CC-Wiki.

# My own solution

I’m okay with the current situation, where the entirety of the post is published (harmonically) under a weak copyleft licence, but where I have the following snippet on my network profile:

I hereby offer all content I author on the SO/StackExchange network also under The MirOS Licence (HTML version with less WTF-8) in addition to “cc-wiki” (CC-BY-SA 2.5 or 3.0, depending on the SO/SE network site, apparently). I urge everyone else contributing here to do the same.

(I should probably plug the full terms there; had to do so for opencaching.de (on which I put my geocache listings under those terms as well) have requested I do that and add a German translation as that site is also used by many people who don’t speak English… which I did.)

This allows authors to choose more free licence terms for their posts (of course I’d be able to exclude individual postings, and postings in which I posted content that’s not mine, such as GNU libc excerpts), but preserves the copyleft-and-attribution-requirement of the general site.

And everyone who does take content of mine under The MirOS Licence will note it also has a requirement to retain full attribution and licence terms (all three of copyright statement, terms and discaimer), while permitting inclusion in other works.

Circle back to harmony of code, data, documentation, media content, etc: this licence specifically uses the term “work” instead of “code” while otherwise being a mostly standard BSD/MIT/HPND-style licence. This is precisely to facilitate putting everything under the same licence terms.

## What SO/SE should do, IMHO

• Stop this hurried action
• Add some wording to the ToS about excerpts from works one does not own (permit it as long as the work’s under some OSS licence), as that’s as much a problem with the current terms as with the new proposed ones
• Possibly allow opt-in or even opt-out (per (site, not network) account) to use a permissive licence but do not waive the notice preservation requirement for them
• Allow opt-out of the permissive licencing for individual posts

This makes it fine for sites such as Code Review to continue operating on the current terms (it’d probably qualify for opt-in) while still permitting you to put e.g. SO under an opt-out scheme for more permissive licencing terms (with more advance notification, this time).

I do hope any changes to the terms such as these would be prominently featured in a to-be-acknowledged page the first time anyone posts after they go live, right?

• Quoting is always fair use, so there shouldn't need to be any special clause for quoting code. – curiousdannii Dec 17 '15 at 10:46
• @curiousdannii “fair use” is a US-american concept and as such does not apply internationally either. In fact, in Germany, citation has rather harsh boundaries. – mirabilos Dec 17 '15 at 10:52
• If quoting wasn't legal then academic writing would be impossible. I've never heard of a country where quotes are illegal, have you? – curiousdannii Dec 17 '15 at 12:17
• @curiousdannii there are extremely specific rules to quotes/citations; unfortunately, Google Translate doesn’t do this article well, but here’s the important part (slightly edited): […] That is, the quote must serve as evidence of the citing work, as basis for discussion, or at least engage critically with the cited work. Basically, there must be a connection between the outer own and inner quoted work. For this purpose it isn’t enough to use a work only to illustrate or solely for informational reporting. – mirabilos Dec 17 '15 at 14:03
• So there may be some situations where quoting code wouldn't count as "fair use" in some jurisdictions, but for many common ones, such as asking for explanations or reviews of code on CR, they should be okay if they're the basis of the discussion. – curiousdannii Dec 17 '15 at 14:07
• There is no such thing as “fair use” outside the USA (and possibly select few other countries). Quoting to-be-discussed code is okay, obviously, but that’d still be part of a posting someone is licencing to SO/SE under CC-BY-SA (if not, they’d violate the ToS), but they cannot give that licence for the quoted part (as they don’t have the licence to do that in the first place). Basically, in CC terms, quotation is -ND, which conflicts with -SA. – mirabilos Dec 17 '15 at 14:22
• Having the notice non-waived makes it basically impossible to take small snippets of code directly from SO and incorporate it into larger projects, as you'd end up having copyright notices longer than the code you are writing all over the place, with legal consequences if they ever get removed (and a high difficulty determining what exactly each copyright notice applies to, so you could never remove them). – Yakk Dec 23 '15 at 15:48
• @Yakk this is wrong, as really small snippets don’t fall under copyright protection anyway due to lack of Schaffenshöhe (don't have the English legal term handy this late at night, basically the amount of creativity and effort needed for a work to become © protected) – mirabilos Dec 23 '15 at 21:06
• @Yakk please learn to spell correctly if you want people to take you seriously. Anyway, the threshold is not size/length but creativity (the oft-quoted 10 lines rule by the FSF is only a rule of thumb and only works for some programming languages and styles). – mirabilos Dec 24 '15 at 12:51
• @mirabilos So you are saying you are wrong, and that there is ambiguity in short snippets being covered by copyright, which means everyone who does a snippet into a large program will have to include a large license comment or open themselves to potential liability, and it becomes exceedingly unclear if the code base evolves when/if that license comment can be removed legally? Personally, I don't want people to have to consult international copyright lawyers to safely use code from stackoverflow in their projects. – Yakk Dec 24 '15 at 15:08
• Inspired by you I copied the snippet into my profile, but unfortunately I'm retiring it now to boycott this proposal / announcement for the same reason as you detailed here. :( – Unihedron Dec 24 '15 at 17:22

I think there's been an excessive knee-jerk reaction against this change. I'd encourage the skeptics to:

Stack Overflow is a question and answer site for professional and enthusiast programmers.

The mission-statement for Stack Overflow, at least, is to provide a useful resource for both professional and amateur/enthusiast programmers. It's intent is not to primarily benefit the open-source community (or any other niche), nor to take sides in an ideological debate on IP/software rights and licensing.

The 'professional' part is important here, as it implies operating for commercial gain. Typically in the employ of a corporate entity, and/or with at least some codebases that are not open-source or otherwise publicly available.

Responsible professionals know better than to incorporate copyleft code into a proprietary/closed-source codebase. Which makes CC-BY-SA licensing a very big problem (technically speaking), to the point where it's in direct conflict with SO's published mission-statement.

Understand CC-BY-SA

CC-BY-SA is essentially a copyleft license. Note that the 'SA' in CC-BY-SA stands for "ShareAlike", which is a licensing requirement that any derivative works which incorporate CC-BY-SA content also be released under CC-BY-SA. And that's where the copyleft problem comes in for professional use.

Interpreted in the context of a software codebase (though as noted in the OP, CC-BY-SA was not really intended for use with software in the first place), it means that if you use a CC-BY-SA licensed snippet in a codebase then strictly speaking you must release the entire codebase under the same license should you distribute any works derived from your codebase (such as a complete application/compiled binary).

Or in other words, copy a snippet from SO into your Android application, then by a strict interpretation of CC-BY-SA (or any other copyleft license) you must release your application's source-code under the same terms if/when you submit it to Google Play. That makes code licensed under CC-BY-SA technically unusable for most professional (i.e. commercial) purposes.

Which, again is at odds with SO's stated purpose.

Consider the reality of the situation

The SO community advertises itself as a place for professionals to collaborate and discuss solutions to technical challenges. And there are undoubtedly plenty of professionals to be found here. And certainly some of them have probably used some code snippets in proprietary, commercial applications. And it's certainly likely that an even greater number of non-members who find a useful snippet on SO through a Google search have used it in closed-source projects of their own.

To pretend that this hasn't happened, doesn't happen, or isn't happening right now is silly. To argue that it shouldn't happen is a denial of SO's published mission-statement. And to try and force the issue and litigate someone over violating the CC-BY-SA license on a code snippet would be virtually impossible if they don't self-nominate (how on Earth are you going to find out that they used your snippet?).

To have all of the code on SO licensed under the terms of CC-BY-SA is actually a massive impediment to the site's intended use-case. It's incongruous with the way that people actually use the site, in practice. On paper, it's a massive risk for any professional users. And in actual fact, it's probably an issue largely ignored by the majority of users (and non-users) who turn to SO for coding help.

The only thing the new changes do is bring the 'on paper' licensing terms in line with the way people actually use SO. Which is something that we should all welcome.

Consider why you post code on SO

Are you here to try to help people solve problems? Or are you here to get your name listed against as many projects as possible, one small snippet at a time? Or to play 'gotcha' with unsuspecting professionals, litigating them when you catch them actually using the code you gave to them?

Unless you're here for the third reason, you don't need to have your code snippets licensed under copyleft! And if you are here for the third reason, you're participating in a highly ideological debate. Which is entirely your right, but which is also something that SE probably shouldn't get entangled with.

And besides, would you really litigate someone for using your code snippet commercially, and do you believe it would really be ethical to do so? Considering that you know there's a good chance the person asking the question is a professional developer, and that you know that professional developers often work on commercial, closed-source code. If you object to your code snippet being used in such a context, then why are you answering their question with code to begin with?

If your motivation is to help others, the licensing changes do not impact you in any way. Or, they might make it possible for you to help even more people, as the new license makes your code usable in places where CC-BY-SA code technically is not.

And note that there's really no issue with respect to attribution. CC-BY-SA requires attribution, and the new license terms still permit you to require attribution. So you can have your attribution if that's what you're after.

The substance of the change is removal of the 'ShareAlike' component from the license, which changes code on SO from being copylefted to being permissively licensed. It's very similar to changing the license terms to CC-BY, which requires attribution, but drops the 'ShareAlike' requirement.

Consider what's fair and reasonable

Forget for a second about the legal precedence that establishes that IP creators can essentially dictate terms according to whatever arbitrary criteria they choose.

Instead look at how much time and effort actually goes into code snippets posted on SO. FGITW means that the average snippet is authored in minutes, not hours. A good FGITW player will at least invest some additional time curating and improving their snippet after it's posted. However, all up it's probably very safe to say that most code snippets on SO are authored in 60 minutes or less.

So what's a fair reward for 30-60 minutes (at most) of effort? Is it a thank-you, some +rep, and being able to (should you so desire) require attribution from people who find your code helpful and use it? I'd say that's fair enough. You made a helpful contribution, and are entitled to recognition for the effort.

But is it fair or reasonable to demand that the person who uses your snippet release their entire codebase under CC-BY-SA, when that codebase may contain many thousands of lines of code and be the product of many person-years of combined effort? I think not. The snippet is a drop in an ocean; it shouldn't allow you to lay claim to the entire ocean.

But that's exactly what you could do if code snippets are licensed under CC-BY-SA (assuming no legal hurdles and technicalities get in the way). And personally I think that's absurd. The value of an answer is real and nontrivial. But it's not so large that providing someone with a code snippet should mean you have a claim to every codebase that snippet gets used in. Attempting to do go goes against the spirit of collaboration, community, and helpfulness that underpins SO, in my opinion.

As such, the new license terms strike a better balance on the 'fair and reasonable' scale, and address a potential imbalance between the value provided by a CC-BY-SA code snippet and the scope of the claim that can be staked against a much larger codebase by leveraging the 'ShareAlike' component of CC-BY-SA.

In closing

I welcome and fully support this change (though I think the suggestions to implement this as a dual-license as opposed to a wholesale swap have merit, so long as it's the consumer of the code who chooses which license they want). You should too. There's no reason not to. Information wants to be free.

The sooner this can take effect, the better.

• I appreciate that you contribute to SO to help people solve problems. You seem to post many more answers on Stack Overflow than questions. Do you feel that "information wants to be free" (and therefore we should force it to be free) applies equally to code that appears in questions? – 200_success Dec 17 '15 at 6:52
• @200_success - The problem with code contained in questions is that it's often broken (otherwise the question wouldn't exist). But generally speaking, yes, I don't see why the same rules shouldn't apply in either case. In terms of asking a question, I wouldn't put up code that I'm not entitled to share, or any nontrivial amount of code from a proprietary codebase. And if people find it useful, even though its presence in a question implies that it's broken/buggy in some way (and therefore non-useful as written), then good for them. – aroth Dec 17 '15 at 7:14
• This answer has a tiny nod to the fact that this doesn't just affect SO in "Stack Overflow, at least", but otherwise the impression that it gives is "This suits SO, and none of the other sites in the network matter". Those who are more active in other sites may disagree quite strongly. – Peter Taylor Dec 17 '15 at 15:35
• @PeterTaylor - Fair enough. My answer is a fairly SO-centric as that's where I spend the most of my time. Though that's also probably where the majority (though certainly not all) of SE's code-snippets live. I wouldn't say there has to be a 'one-size-fits-all' solution to license terms across all SE sites, but at the same time I can't think of a really strong counterargument against that approach either. – aroth Dec 17 '15 at 16:02
• Note also that some of the other sites have code which isn't just a snippet. E.g. there are full self-contained programs in answers to this question which represent several hours of work. – Peter Taylor Dec 17 '15 at 16:31
• I don't think this is correct: "if you use a CC-BY-SA licensed snippet in a codebase then strictly speaking you must release the entire codebase under the same license". I would argue that the copied source code is being added to a Collection in your software project, from the viewpoint of this license. That means that the copied source code is under the CC BY-SA license, but the rest of your source code is unaffected. My full analysis: meta.stackoverflow.com/a/300861/386091 – Ron Dec 17 '15 at 17:09
• @Ron Are you sure? 100%? Are you a lawyer? – assylias Dec 17 '15 at 19:36
• @Ron - That's not how copyleft works. As another answer points out, CC-BY-SA is GPL-compatible, and certainly under the GPL all of the source-code that's compiled with the copied code is affected. You could, of course, make the argument you describe in court and hope the decision goes your way. But few developers would be willing to take that risk. And CC's description of ShareAlike does not agree with your analysis: "If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original". – aroth Dec 17 '15 at 23:15
• @assylias No, I'm not a lawyer. I wish there were clear guidelines on StackOverflow about how to obey the CC-BY-SA 3.0 license with source code. Since, there are not, I've had to do the analysis myself. – Ron Dec 18 '15 at 22:14
• @aroth Can you point to a careful analysis (from a lawyer, ideally) saying why using a snippet of code from StackOverflow requires redistributing your whole proprietary code base under CC-BY-SA 3.0? You would think that if that were the intention, there would be prominent warnings about that somewhere! – Ron Dec 18 '15 at 22:14
• You can take MIT (or SO)-licenced code and use it almost everywhere, distributing the whole under whatever license you want. Dual-licensing is thus (mostly) moot, and adding that just complicates stuff. Better leave it out, the final result is the same. – vonbrand Dec 19 '15 at 3:02
• The GPL software case you linked to was not decided based on anything to do with the license -- the judgement was a default because the defendant did not participate in the case. The decision in Drauglis v. Kappa Map was in favor of the latter -- the "Share Alike" claim was denied. (Additionally, none of the other CC-related cases you linked have anything to do with the Share Alike terms.) Your citations do nothing to support your portrayal of Share Alike. – jscs Dec 19 '15 at 20:15
• @JoshCaswell - Yes, it was a default judgement. However if you read the actual decision ("Westinghouse infringed on Plaintiffs' copyright by distributing BusyBox [...] in a manner that did not comply with the License"), it does uphold the validity and enforceability of the GPL. The default judgement would have gone against the plaintiff had the License not been enforceable; a default judgement doesn't mean you win if your claims are prima facie invalid. – aroth Dec 19 '15 at 23:54
• No, that's not how it works in civil suits. There's no presumption of innocence as in a criminal trial. If you don't defend against the complaint, the default judgement means you've lost, without the court considering the merits of the complaint. See the second footnote of the Westinghouse PDF you linked. – jscs Dec 20 '15 at 20:03
• (The plaintiff would have had a default entered against them had they brought the complaint and then failed to show up.) – jscs Dec 20 '15 at 20:13

I opened a question about clarifying SO's intentions on licensing a while back so I would simply like to say thank you.

Thank you for taking the time and resources to address this issue. I'm sure there were a lot of tough decisions to be made and I'm sure handling the reaction is going to be pretty difficult as well.

So again, thank you for addressing this.

To the people who want to offer an opinion on the outcome I'd recommend you read this question and others before throwing in an opinion. It breaks down the complications with the prior license and seems to demonstrate interpretations fell one of two ways. If you want to have a constructive impact on what's happening it will benefit to be aware of what has already been discussed.

• I'm not gonna say that months of going back and forth on this, drawing up plans only to scrap them and start over, nagging lazy co-workers for feedback and trying to parse legal objections have driven Sam & Tim completely mad... I have entirely too much respect for them to say that. But they could probably both use a gallon or two of strong drink at this point. – Shog9 Dec 16 '15 at 21:50
• @Shog9 - If anybody involved is in the bay area I'm more than happy to buy them a drink or 10. :) – Spencer Ruport Dec 16 '15 at 21:53
• @Shog9, probably better if they don't start over, nor get sloshed. Instead, I'd welcome a clear-headed announcement to drop the proposed change and just leave the licensing as it is. CC-BY-SA 3.0 is a great license for user contributions, and the proposed change is frankly incoherent. – user136089 Jan 4 '16 at 1:36

So we've got

1. Contributors who want their code to be used as freely as possible,
2. Contributors who want their code to be used only with attribution,
3. Programmers who want to learn from code examples without copying from the code itself,
4. Programmers who want to use code under clearly defined terms so they can steer clear of copyright infringement, and
5. Programmers who just want to use code in their projects without having to worry about all that legal mumbo-jumbo.

Keeping everything CC-BY-SA works well for group 2. Maybe for group 4 as well, except that CC licenses (aside from CC0) are generally not recommended for use on software.

MIT-licensing all code from 2016 onwards is also fine for group 2. It might help group 4, except you don't know for sure whether the user who posted the code is actually the author... or got it from somewhere outside StackOverflow... or modified it from another StackOverflow question or answer which isn't necessarily MIT-licensed... etc.

A quasi-MIT license that makes attribution optional, unless the author comes and asks for it later, adds future uncertainty and thus is even worse for group 4.

A less restrictive option would be to make code contributions available under the Unlicense, the CC0 Public Domain Dedication, or similar "do what you want" terms. That would satisfy groups 1 and 5, although group 2 wouldn't approve. Group 4 might be a little worried as well, since there's some dispute over whether waiving copyright is legally valid (though that's a much longer discussion).

Group 3 would be satisfied with pretty much any licensing terms.

I think the best way to strike a balance is to make everything CC-BY-SA by default, and allow individual contributors to share their code under more permissive terms if they so choose.

A good start would be providing an option to add licensing/permission notices in user profiles. For example:

"All the code I contribute to StackOverflow is copyright <My Real Name> and open-source under the MIT License (http://opensource.org/licenses/MIT)."

Or

"All the code I contribute to StackOverflow is available under the CC0 Public Domain Dedication (https://creativecommons.org/publicdomain/zero/1.0/deed.en)."

This helps groups 1, 4, and 5 by lifting at least some restrictions on code sharing. It also satisfies group 2, since the attribution requirement is preserved for those who want it.

I won't pretend there's a perfect solution. Certainly not for groups 4 and 5. The safest option for avoiding copyright infringement is always to write your own code -- possibly using the same ideas you've seen elsewhere (since ideas can't be copyrighted), but expressing those ideas in your own words.

And from my perspective, the central purpose of StackOverflow is to learn. Not just to learn how to fix some specific code, but to gain the ability to solve problems of that type in any form. And for that purpose, reading the answers to learn from them -- without copying their text -- is perfectly fine.

• Nice summary - Group 2.5: Contributors who want to prevent their code from being used in commercial projects or open source projects with permissive licenses. – assylias Dec 17 '15 at 10:31
• No CC licence works well for code, and CC themselves recommend to not use CC0 for any new works of any kind due to problems with it. Public Domain is not a licence grant, many people (e.g. most EU citizens) cannot place their work into PD if it’s eligible for copyright protection, and it does not, unlike licences (which work under Berne Convention), cross country boundaries, so it would not make reuse by people with different nationalities possible. – mirabilos Dec 17 '15 at 10:48
• @mirabilos the op clearly says that there is some dispute over whether CC0 or unlicense are valid and does not recommend using them. – assylias Dec 17 '15 at 11:11
• @assylias sure, but while he mentions dispute I can confirm that waiving copyright does not work ⓐ for citizens of some countries, and ⓑ across country boundaries (as the Berne Convention only deals with copyright protection, which is the tool regular OSS licences use). – mirabilos Dec 17 '15 at 11:15
• Even in the U.S. it's very hard or impossible to make something public domain -- basically, public domain only applies to government works or if the copyright term expired. CC0 is meant to be a waiver of rights to the extent possible, with a permissive license as a fallback. Not everyone's comfortable with it, though. For example, it's recommended by the Free Software Foundation but not by the Open Source Initiative. – jkdev Dec 17 '15 at 11:23
• @jkdev it’s not, in its current form, suggested by Creative Commons, which is why OSI cannot recommend it (as CC withdrew it from the OSI approval process). – mirabilos Dec 17 '15 at 14:24
• Seems they're sending some mixed messages. Here's from the CCO FAQ: "CC0 is suitable for dedicating your copyright and related rights in computer software to the public domain, to the fullest extent possible... Unlike CC licenses, which should not be used for software, CC0 is compatible with many software licenses, including the GPL. However, CC0 has not been approved by the Open Source Initiative and does not license or otherwise affect any patent rights you may have. You may want to consider using an approved OSI license..." – jkdev Dec 17 '15 at 17:08
• Just want to add that one also learns by copying... as long as one understands what one has copied. Sometimes it's just difficult to do things different, even if you do them kind of on your own (with help). – Trilarion Dec 18 '15 at 20:46
• @Trilarion Very true. There's a reason that developers often use the Chinese Wall technique / clean room design to write non-infringing software... It's not always possible to un-remember code after you've seen it. – jkdev Dec 19 '15 at 23:43
• What about group (6) Programmers who don't want to have to spend 40 minutes figuring out what they have to do to copy 3 lines of code. – Robin Davies Dec 27 '15 at 18:06