1

I've came across StackOverflow's license a week ago, which I had no idea about. Seems they use CC BY-SA there (before, 3.0, now, 4.0). If I'm publishing code there, it's because I want anyone to do whatever people want with it. Get it to some app to be sold, change it, improve it, get it on a free app, whatever, I don't care. If I did care, I'd put them on GitHub or similar with some license. I might find cool to have credit in case the person just copy-pastes the code (which is perfectly fine for me), but not a big deal, I don't mind not having.

Also I came across a person's idea of putting the license they want their code snippets to be used with, on their Stack Exchange profile, as I did with mine. But I think I may have chosen the wrong license.

So which license should I choose? I've heard of about CC0, WTFPL and Unlicense. But all of those seem to have problems. Unclear, badly written, always something. Then there are other licenses, like MIT, GPL, Apache... But I'm not sure those are intended for what WTFPL means, but seems not to be able to provide. What's actually the best license for "WTF you want to do" but that actually works...? So I can put that on GitHub little projects and Stack Exchange profile and on any other places I find that the code is just for people to do whatever they want with it.

PS: I don't understand too much of this. I started to read a bit about this a day or 2 ago, so I don't really know what all the licenses do and I'm not used to this, for example.

Thanks in advance for any help!

EDIT: Happy New Year everyone!!! (Off-topic, but anyways hahaha)

  • 2
    What criticism have you seen of CC0? My understanding is that it's the gold standard in ultra-permissively releasing copyright, drafted my lawyers, using two mechanisms in tandem (public domain dedication coupled with ultra-permissive release as a fallback, depending on jurisdiction). – apsillers Dec 31 '20 at 0:35
  • That's not intended for software (source-code or not) use. Also people here on Stack Exchange saying it's not a good idea for software source-code or on Quora. Though, it's also said (and by CC themselves) that it's an approved license and can be used for software. As a beginner on this, I just got 100% confused on which license to use, as people say not to use each of those I wanted hahaha. Started with WTFPL, seems a bad idea. Kept on with Unlicense. Bad idea again. Chose finally CC0. Found people not recommending it (or the opposite). Gave up and asked - might spare me infinity xD. – DADi590 Dec 31 '20 at 0:42
  • @DADi590 Please actually link to a specific criticism of CC0. "People here on Stack Exchange [...] or on Quora" encompasses a huge group of people, some of whom are more knowledgeable than others. – Philip Kendall Dec 31 '20 at 13:36
  • The CC0 license is the exception to the "rule" not to use CC licenses for software. – Bart van Ingen Schenau Dec 31 '20 at 14:20
  • @PhilipKendall quora.com/Should-CC0-be-used-for-source-code-and-software / opensource.stackexchange.com/questions/887/… softwareengineering.stackexchange.com/questions/147111/… / opensource.org/faq#cc-zero. I closed various sites, but those are the ones I found that were open and talked about CC0 (better to use Ctrl+F in some, as they're not about CC0 mainly, but mention it sometimes. – DADi590 Dec 31 '20 at 15:24
3

The CC0 is an excellent instrument for making it possible for everyone to use a software. It effectively disclaims all copyright you may have to the fullest degree possible. Thus, if you want anyone to use your code without further restrictions (including without any requirement to attribute you), then CC0 is an excellent choice.

There are some downsides to CC0. While CC0 is well-suited for software (unlike the other CC works), it only releases copyright but explicitly not any patent rights. Even if a software is available under CC0, a recipient of the software might not be able to use or modify it if the software is covered by a patent. Whereas many licenses are silent on the patent issue (and might include an implied patent license), CC0's explicit retention of patent rights means that it might not ensure downstream usability. When the CC0 was discussed in the Open Source Initiative license review process, this patent issue prevented a consensus from being formed on the question whether the CC0 was an open-source license.

This should not prevent you from using CC0. It is the best available instrument for releasing copyright to the fullest degree, and is much more rigorous than the confusingly-drafted Unlicense (which did eventually get OSI approval in recognition of its wide use, despite these problems).

However, to users who care about patent rights (even if you don't care about patents at all), it would be considerate to offer your software under multiple licenses and instruments, at the user's choice. For example, offering your code under CC0, MIT, or Apache-2 (at the user's choice) would make your code acceptable to most downstream users. This kind of dual-licensing is fairly common, e.g. most Perl-related code is dual licensed under Artistic OR GPLv2, and most Rust code is dual-licensed under MIT OR Apache. The only hitch is that CC0 disclaims copyright to the fullest degree, whereas MIT and Apache depend on your copyright. I'm not sure how these aspects would interact.

At some point Stack Exchange had planned to migrate any code snippets to an MIT-style license that wouldn't require attribution, but that initiative was shelved after legal difficulties became apparent (can't retroactively relicense CC-BY-SA content) and community response was somewhat negative (this was back when SE still listened to users). Thus, offering an additional license in your profile is the best way to open up your code to more users, though users might not be aware of this opportunity, and the status of such extra licenses when people edit your posts is unclear.

  • Thank you! About the patents part, if I publish some code under CC0 and it's not patented, can everyone use it then? Would mean as long as I don't patent my work, CC0 will grant anyone free access to do whatever they want. Would that be it? Or I got it wrong? Also, about editting answers. Could I write on my profile that all edits to my answers must agree with keeping the same license that I chose for the answer? (Or in case almost no one would see that - likely -, in answers with much code, I could write that on them directly) Would that work? – DADi590 Dec 31 '20 at 17:56
  • I could also say in such answers that the license to apply is on my profile. Is that a good idea or must be explicitly written on the answer? – DADi590 Dec 31 '20 at 17:56
  • 1
    @DADi590 Yes other people are presumably free to use your code if it's not subject to patents, but just with the CC0 they have no guarantee from you that you aren't secretly holding patents that you could enforce later. The Apache-2 solves this very elegantly. – amon Jan 1 at 13:05
  • 1
    @DADi590 No, if you only have some license terms in your profile you cannot assume that editors of your posts have read them. That's completely unenforceable, just like “if you read this, you owe me $100”. It's considered bad practice to put a footer or signature on you Stack Exchange posts, but I sometimes leave <!-- comments --> for editors in my posts. I also have at least one answer that included substantial self-contained code where I explicitly added an Apache license header. – amon Jan 1 at 13:07
  • Ok! Thank you for the help and clarification! – DADi590 Jan 1 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.