One question was so interesting that I worked out a solution as program. While I would like to share it, I am not happy with the Creative Commons License. I have read the already existing posts and I find the legal problems as much too unspecified and problematic (When it is code, when a snippet, does other laws apply to me etc. etc.)

I would prefer to offer it as Public Domain. No restrictions at all, no enforced copyleft, no need to tag me as author. The opportunity to get rich by exploiting me, you name it. ;-)

As the idea of the Creative Commons is that content will be available on SO even if the author later disagrees, I see no conflict with this goal because releasing all rights would automatically give SO the right to retain and modify the code.

So, is it possible to post this code under Public Domain ? Or use less restrictive licenses in general ? I think (hopefully) that many people here would like to share their code and snippets as Public Domain, too.

  • 1
    What specifically is restrictive about CC-by-SA?
    – Makoto
    Commented Jul 15, 2012 at 17:11
  • Add a license comment that states so. Or add a link to an external repository. Which you should do for longer code samples anyway.
    – mario
    Commented Jul 15, 2012 at 17:22
  • Enforcement of share-alike (which is copyleft) and that the work must be attributed. Another problem is that I come from another country and it is doubtful that the law here does recognize such licenses as legal binding at all. By giving up all rights no legal problems arise. Commented Jul 15, 2012 at 17:24
  • @BoltClock What else should it be? The SA clause is clearly copyleft. Commented Jul 15, 2012 at 17:25
  • Related/possible duplicate: meta.stackexchange.com/questions/2489/licencing-code-snippets
    – Adam Lear StaffMod
    Commented Jul 15, 2012 at 17:26
  • Posting code is no problem, you can always dual license or use public domain. There are several users who do that. But SO's current practice is problematic for people using code posted on SO. Commented Jul 15, 2012 at 17:27
  • @CodeInChaos: Exactly that is the problem why I don't like the CC SA license. Commented Jul 15, 2012 at 17:28
  • @CodeInChaos: Looks like I completely missed the meaning of "copyleft" back there. D'oh. Commented Jul 15, 2012 at 17:30

2 Answers 2


There's no problem at all with you posting your own code somewhere else and explicitly placing it into the public domain. Such dual licenses are quite common. There's no mechanism for licensing different bits as posted on the SE network, but if you distribute the code through your own channel, you may do it however you wish.

  • Well, if it settles this...The problem I see here are broken links in future which must be cleaned up. What I do not understand is the argument against less restrictive licenses. Would you support them if someone magically do all the work or is there another reason for insisting on Creative Commons ? Commented Jul 15, 2012 at 17:31
  • 1
    I was unclear, I guess. Post the code here, and also post it elsewhere. When you post it elsewhere, include a declaration that the code is placed in the public domain. Here on SE, just post it. Commented Jul 15, 2012 at 17:58

Anything you produce, you own the copyright to. You can release that to the public under whichever license(s) you wish. (Note the potential plural.) By posting it on SO, you release it under the CC-BY-SA 3.0 license. There’s nothing stopping you also releasing it under CC0 or WTFPL (or both).

Or you can “release it to the public domain” (possibly). As the FAQ for the WTFPL says,

Unfortunately, the definition of public domain varies with the jurisdictions, and it is in some places debatable whether someone who has not been dead for the last seventy years is entitled to put their own work in the public domain.

Wikipedia has a template for that: PD-Self:

I, the copyright holder of this work, release this work into the public domain. This applies worldwide.

In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

This seems reasonable. And I don’t see why you’d need to host it elsewhere to put such a license on it. There's nothing stopping you putting some code here with a comment at the top:

// License: WTFPL (http://www.wtfpl.net)

That’d be sufficient.

Alternatively, you could put a note in your profile to the effect that all your code snippets on this site are available under such-and-such a licence.

(This answer is licensed under both CC0 and WTFPL.)

You must log in to answer this question.

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