Creative Commons specifically recommends that its licenses not be used for software, and I am aware that discussions occur frequently on this topic. Users often come to the site seeking a solution, and when that solution is posted they will then copy it to their own code, but that requires them to license their software under CC-BY-SA.

The solution? All program code posted to Stack Overflow should be licensed by default under a license that permits its free use in software. I would recommend the Mozilla Public License, version 2.0, which still provides some copyleft protection but is fairly easy to understand. Also note that the MPL explicitly grants you the right to display the code, something that could be useful for posting on other websites. Of course, the poster would have the right to choose another license if they wished.

Of course, we can't change any of the code that's already been posted to SO. It's under CC-BY-SA, and the copyleft can't be broken. So some code-marking system would have to be developed to mark pre-change and post-change code.

  • 11
    Why not just Beer License the whole damn site? – Manishearth May 1 '13 at 4:31
  • Because Stack Overflow contains a significant amount of other important programming information for which a software license would be unsuitable. – Lee Sleek May 1 '13 at 4:40
  • 2
    @Manishearth because encouraging users who may be under the drinking age in their country to drink a beer could be seen as enabling a minor. – Richard J. Ross III May 1 '13 at 4:40
  • 1
    @LeeSleek: It was a joke :/ – Manishearth May 1 '13 at 4:45
  • 2
    Never assume jokes will be taken as such in nonverbal environments. I recommend using pseudo-HTML such as </sarcasm>. – Lee Sleek May 1 '13 at 5:01
  • 8
    I find pseudo-HTML super lame. Meta is a very humorous environment, you'll get used to it. :) – Pekka May 1 '13 at 10:10
  • 1
    "Please give me a beer. By the way, I don't like beer." – user206222 May 2 '13 at 21:49
  • "I here for do not permit to relicense any content, including source code in any form, I contributed to any Stack Exchange site still attributed to me to be relicensed under any lesser terms then provided by CC-BY-SA." I don't want anything more "relaxed" then that for what I contribute(d), I'm sure I'm not the only one. – Time Traveling Bobby May 31 '13 at 11:02
  • @Manishearth: I actually like that idea, imagine what would happen on a big SE meet-up. – Time Traveling Bobby May 31 '13 at 11:07
  • "...and when that solution is posted they will then copy it to their own code..." Actually, I think that's the core problem that needs to be tackled. But I fear that's outside of the scope of SE ("don't C&P code from the interwebs!"). – Time Traveling Bobby May 31 '13 at 11:14

The problem I see with this suggestion is that there are already almost 5 million questions on the site, with tons of code.

AFAIK, you can't just "relicense" a load of code that's already been released under a different license.

Of course, a small info note could be added to pre-existing code to say it's licensed under CC BY-SA, and the footer changed to say user contributions are licensed under XYZ, unless otherwise mentioned.

IMO though, this would look a bit silly.

Based on Jeff's blog post, it would seem that the reason for choosing CC BY-SA is due to the 'attribution required' element of it. From what I can see from skimming the MPL, it doesn't seem to be requirement.

  • 1
    The attribution part isn't the problem. The share-alike part is. – CodesInChaos May 1 '13 at 12:49
  • Some other licenses I'd recommend from skimming this page: the Apache License 2.0 ("You must cause any modified files to carry prominent notices stating that you changed the files"), the Vim License with some SO-specific modifications (see section II[3]), or perhaps the Lesser GPL, which requires modifications be marked as such. Or, the code could be downgraded to CC-BY, which would also be alright. – Lee Sleek May 1 '13 at 14:36
  • 1
    "AFAIK, you can't just "relicense" a load of code that's already been released under a different license." I'm not a lawyer, but I confirm this. Only the copyright holder/author can relicense that stuff. Since this is "BY" we clearly retained our copyright, and did not pass it on to SE. Relicensing content on this site would require the consent of every single user who ever posted something. – Time Traveling Bobby May 31 '13 at 11:11
  • 1
    @M.NightDemonbobby By "all code snippets" I meant "all future code snippets" because of this. I'll edit the post to reflect this. – Lee Sleek May 31 '13 at 14:23

You must log in to answer this question.

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