8

I'm part of a programmers community over the internet. I've been struggling with the code that's shared over the site because it's licensed under the CC BY-SA. I'd love to accomplish with the law and the "spirit" of the terms of use of the community, so in order to get a better understanding about the current situation and clarification about solutions, I had sent a couple mails and inclusively initiated a discussion about.

Sadly there's a lot of opinions among users about if the terms of use are legally valid or applicable in real life. But the good news are that the network on which this community is under, have taken a big step in order to solve the problem.

The thing is that there's a lot of opinions about, and I'd like to know which is the best license available for code snippets considering that most people which enters the site may not be that worried as me about licensing - I'd like to be able to copy little pieces of code without attribution nor legal ambiguity into my own libre or commercial projects and share my contributions freely as well (altough I would love to give and get attribution on more sophisticated code).


I think the whole problem could be summarized in this explanation:

  • Is not reasonable to require attribution for code snippets (as a matter of fact)
  • Is absolutelly reasonable to ask attribution on actual code blocks (or simply "code")

This is a similar situation in respect to what the FSF addressed before, and solution could be the same. The question in that case is how to make it practical and not messy.

1
  • 1
    Check the discussion surrounding the push by SE to move to a modified MIT license for code published on this site, e.g. here.
    – vonbrand
    Dec 19, 2015 at 22:26

2 Answers 2

7

I've been struggling with the code that's shared over the site because it's licensed under the CC BY-SA...

So you've identified that there's a problem with licensing it under BY-SA. Good: CC BY-SA is discouraged for code.

Is copy-pasting code from Stack Overflow an infringement of CC BY-SA 3.0?

Without attribution, absolutely yes. No copy-pasta without saying where it comes from.

I'd like to know which is the best license available for code snippets...

This is unanswerable because it's incredibly subjective. Best depends on your situation and what you're trying to achieve.

I'd like to be able to copy little pieces of code without attribution nor legal ambiguity into my own libre or commercial projects and share my contributions freely

This is the important bit. You want to be able to copy snippets:

  • without attribution
  • commercially
  • and have a right to share on

Without attribution is probably the hardest bit here. I don't actually recall any open-source license that allows you to do this, so you're looking at going full public domain (or using CC0, which is slightly different).

4
  • I agree that CC0 would be useful in the case of tiny (or "unsophisticated") code snippets, but does lacks of explanation in how to give attribution when something in fact needs attribution. Should we trust on user's good judgment? Should we create a new license considering that the situation is very particular? (that makes any sense?) Dec 18, 2015 at 19:02
  • @Hacktivista CC0 never requires attribution. If you want to be able to copy snippets without attribution, that sounds perfect for you. There are no true open source licenses that don't require attribution.
    – ArtOfCode
    Dec 18, 2015 at 19:05
  • I agree. But I think your answer is incomplete, since does not provide a solution for the specific attribution problem, which is "in which case attribution is logical" and "how to address that situation". Dec 18, 2015 at 19:12
  • @Hacktivista On the contrary, your question didn't ask that. You asked for a license that lets you copy code snippets freely, and possibly attribution for more sophisticated code. Since there isn't one license that does both, I've recommended something for your first use case.
    – ArtOfCode
    Dec 18, 2015 at 19:14
4

The most luxorious solution would be to allow authors to pick their license terms themselves.

When an author formats a piece of their post as code, the system prompts them for which license(s) to put it under. Users should also be able to set a default in their preferences, but still override it on a post-by-post basis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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