7

Edited the question to only contain the part which is not being answered by the linked question

I know it is possible to dual license code posted on Stack Overflow.

Does this also apply retroactively to code which was posted before adding the license text to one's user profile?

23
  • 3
  • I don't think licensing is something you need to worry about when answering on SO. It's not like SO is going to sue someone for using code they copy-pasted from an answer...
    – Cerbrus
    Commented Sep 6, 2021 at 12:11
  • 1
    If you did add an additional licence note that the user only has to abide to the licenses of the post at the time they used it. Adding a licence that might require additional restrictions on them would not be enforceable if they used that solution 9 years ago.
    – Thom A
    Commented Sep 6, 2021 at 12:11
  • 6
    Does this answer your question? Is it valid if one licenses their own answer at Stack Overflow? Commented Sep 6, 2021 at 12:13
  • 2
    Does anyone actually attribute all the code they copy from SO? What if they don't? What if they write a line that happens to be identical to one on SO? Small snippets of code aren't practically copyright-able.
    – Cerbrus
    Commented Sep 6, 2021 at 12:15
  • 4
    @Scratte: What's "trivial"? Where's the line? My point here is: Why worry about legal implications on a theoretical problem that's practically impossible to occur?
    – Cerbrus
    Commented Sep 6, 2021 at 12:17
  • 2
    @Cerbrus To me, trivial is when it's something that I do all the time or that is reoccurring in all the documentation. Like boilerplate. I never attribute that. When I'm in doubt, I'm more inclined to attribute it. It keeps me not worrying and as Nick also said, it makes it easy to find the source again.
    – Scratte
    Commented Sep 6, 2021 at 12:23
  • 1
    @Cerbrus they likely refer to the legal concept of trivial code. See What is defined as trivial code when licensing a project for an example. There is no exact line to be drawn - it is determined on a case-by-case basis
    – 0Valt
    Commented Sep 6, 2021 at 12:23
  • 2
    @Scratte / Oleg: All I'm seeing there is that there's no real definition of "trivial"... Even that one answer Oleg linked already contains 3 different definitions of trivial code. Again, unless you're working for a huge multinational and you're taking "inspiration" from another huge company's code (How'd you even get access to that?), I really wouldn't worry too much. Now consider you're just copying some lines from SO... I'm not saying you shouldn't attribute it if you wanna, but you're not getting into trouble if you don't.
    – Cerbrus
    Commented Sep 6, 2021 at 12:29
  • 3
    Then I'll TL;DR my practical opinion: "Don't worry, be happy!"
    – Cerbrus
    Commented Sep 6, 2021 at 12:34
  • 1
    On an off-note to the OP: yes, you are dree to dual/triple/quadruple license all the work you have provided the new license does not violate CC-BY-SA (also might be worth looking at what SE previously employed - there were a couple of debacles about forced relicensing in the past). In general, this means that you can apply a more permissive license, but not a less permissive one. When you post the same thing somewhere else - this is a bit more complicated.
    – 0Valt
    Commented Sep 6, 2021 at 12:38
  • 3
    @OlegValter You can apply a less permissive one, but people will always have the option to use CC BY-SA. You can offer as many licensing options as you want, and the person who wants to use the code can pick which one they wish to use.
    – Ryan M Mod
    Commented Sep 6, 2021 at 12:44
  • 1
    As I said here, Creative Commons recommend against using Creative Commons licenses for software. We use CC-BY-SA licenses here because Stack Overflow posts are effectively a form of documentation that (may) contain code samples. They are not intended to be a primary software distribution mechanism.
    – PM 2Ring
    Commented Sep 6, 2021 at 12:56
  • 1
    Another off-note about one of your previous revisions. Your legal department is not overly cautious, they are, strictly speaking, correct. Note the last 2 bytes of "CC-BY-SA": SA means "Share Alike" which explicitly requires "you must distribute your contributions under the same license as the original". However unlikely it is that the company will ever be found guilty of infringing on that clause, the legal department has a valid concern to protect everyone against.
    – 0Valt
    Commented Sep 6, 2021 at 16:48
  • 1
    @TimMeyer The question linked by JeanneDark does, in fact, answer your question. To be specific, Pekka in the top voted answer says "The copyright of the content always remains with the author and they can re-license anything they publish on Stack Overflow any way they choose in parallel to SO", which covers your question.
    – Makyen Mod
    Commented Sep 6, 2021 at 18:43

2 Answers 2

12

Yes

Licensing your code to Stack Overflow under CC BY-SA doesn't take away any of your rights: it only grants rights to other people. One of your rights is the right to license your code to others. You are free to do so under any license, at any time—there's no need for it to be when you originally posted it.

Of course, your code is still also available under the CC BY-SA license. Providing the code under an additional license allows the person using it to choose which license they use it under.

4

Deep in the legal text (Subscriber Content), it says that by posting here your content “is perpetually and irrevocably licensed to Stack Overflow on a worldwide, royalty-free, non-exclusive basis”.

What this means is you have only licensed your content here under CC BY-SA: you still own the content. You are free to release your content under other licenses (even by republishing elsewhere: that is the “non-exclusive” part).
Many people choose to add a license to their content by saying so in their profile.

1
  • 5
    You are not free, therefore, to offer your code somewhere else with an "exclusive" license. Commented Sep 6, 2021 at 16:54

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