3

Does the current applicability of the CC-BY-SA 4.0 to most Stack Overflow content actually mean that one can only embed (or adapt) code content from Stack Overflow in their own software if they make their own software open source?

4
  • 3
    Maybe try Open Source for this? Commented Aug 5, 2023 at 4:46
  • 1
    Does this answer your question? The MIT License – Clarity on Using Code on Stack Overflow and Stack Exchange Commented Aug 5, 2023 at 17:44
  • 1
    @KarlKnechtel The MIT license was never adopted (and couldn't have been retroactively anyway for previous content). The company came never back and dropped the idea. I don't see how it's relevant for any current situation. Commented Aug 9, 2023 at 9:22
  • @vandench just noting that it seems your comment is literally opposite to the answer below. I'd consider removing it if the answer below were correct as it seems it is.
    – matanox
    Commented Aug 17, 2023 at 11:30

1 Answer 1

4

Yes

Yes, you must use CC BY-SA itself or a compatible license. This requirement is in accordance with the "SA" (ShareAlike) principle.

  1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.

Section 3(b) ShereAlike

However, not all code is subject to copyright protection. Short or simple code may not be eligible for copyright in many countries. In such cases, there is no specific license requirement to adhere to.

See also Do I have to worry about copyright issues for code posted on Stack Overflow? .


Note to comments

IIRC CC-BY-SA is more liberal than that, you don't need to make the code public at all. I think the only real requirement is attribution, i.e. just add a code comment linking to the answer on.

This might refer to CC BY . However, when the "SA" (ShareAlike) clause is attached, additional obligations come into play.

Does this answer your question? The MIT License – Clarity on Using Code on Stack Overflow and Stack Exchange

The proposal to change the code license to MIT has been "delayed indefinitely".


Added in response to comments (2023-08-17):

Distinction between code license (CC BY-SA) and copyright

That said, the distinction you make between license and copyright isn't all clear to me.

  • Copyright is the right owned by the copyright holder
  • A license (CC BY-SA in this case) is a contract between the copyright holder and the user

By agreeing to the license (CC BY-SA), you are entering into a contract with the copyright holder. This contract allows you to do some of the things that require permission from the copyright holder. It is a convenient system for both parties because there is no need to exchange a contract each time.

Now, let's think about code that is not copyrighted from the beginning (for example, due to lack of originality or creativity). There can be no contract as described above for such code. Because there is no copyright holder from the beginning. It's not CC BY-SA or any other license. No one can forbid or allow anything based on copyright.

Can code from "most Stack Overflow answers" be used in proprietary software?

It even reads as if self-contradictory a little, perhaps it can be made clearer about whether or not code can be put into use in proprietary software without it infringing the CC BY-SA license of most StackOverflow answers?

There is no clear answer.

  • Code licensed under CC BY-SA may not be used in proprietary software. This is clear.
  • Non-copyrighted code is not CC BY-SA. This is clear.
  • Non-copyrighted code can be used unconditionally, whether your software is proprietary or not. This is clear.
  • However, the boundary between whether the code of the answer is copyrighted or not is not clear. It depends on factors such as originality and creativity of that code. Ultimately it should be decided on a case-by-case basis.

To be safe, one option is to assume that all code is copyrighted and always follow the license (CC BY-SA). In this case, it cannot be used with proprietary software.

Of course, "consulting a legal professional" is exemplary behavior.

3
  • Thanks. I doubt the majority of stackoverflow users adhere to this, most people I knew just copy paste into their proprietary code, but maybe I'm inaccurate on that. It's a rather ironic license for a website dedicated to code solutions, really.
    – matanox
    Commented Aug 17, 2023 at 11:24
  • That said, the distinction you make between license and copyright isn't all clear to me. It even reads as if self-contradictory a little, perhaps it can be made clearer about whether or not code can be put into use in proprietary software without it infringing the CC BY-SA license of most StackOverflow answers?
    – matanox
    Commented Aug 17, 2023 at 11:28
  • 1
    @matt In most cases, the help you should get from StackOverflow should be how to address a problem; that knowledge you learn is not subject to the license terms, only the code is. Commented Aug 17, 2023 at 19:04

You must log in to answer this question.

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