What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 149 Stack Exchange communities.

Possible Duplicate:
Do I have to worry about copyright issues for code posted on StackOverflow?

A very basic doubt: the answers that are quoted on SO, do they come under any license?

Is it OK(/Legal) to copy whole/parts of code provided in answers by users?

I personally make sure to just take cue from the idea and try to re-write the solution but it might not be a case for every problem, hence the question.

My main concern is if I ask a particular question for which someone gets answer off the net and pastes it and that particular code was under some license. This can also be for ideas/solutions provided by users.

I did not find anything on FAQ or previous posts regarding this.

  • Ivar (marked post as community wiki just in case)
share|improve this question

migrated from stackoverflow.com Jun 23 '10 at 23:13

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Jeff Atwood Jun 24 '10 at 0:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
My code samples always have integrated copy protection. It will destroy your computer if you run it ;) –  Felix Jun 23 '10 at 23:18
    
@Felix, next time, i will think twice before i look at the code in your answers :D –  topgun_ivard Jun 23 '10 at 23:38

1 Answer 1

up vote 4 down vote accepted

They're licensed under CC-BY-SA, so your code must be under CC-BY-SA as well if you want to copy snippets, and your code probably isn't. See the CC-wiki logo at the footer of trilogy sites.

share|improve this answer
    
ahh..i missed that...thanks! - ivar –  topgun_ivard Jun 23 '10 at 23:25
    
How is the CC-BY-SA "viral" as it's described here? Even ignoring fair use (which possibly allows snippet use already), the full license clearly has an "exception" "to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;", where "Collections" is pretty broadly defined. At worst, if you kept your SO code in one place and/or, eg, MPL'd files w/ SO code with attribution, your "Collection" would be fine/unaffected, right? –  ruffin Aug 25 '13 at 17:52
1  
Are you sure about source code having the CC-BY-SA license? It seems like the regular practice is to give the CC license to the posts, and give the source code a software license. CC-BY-SA isn't meant for software (as the creators of CC-BY-SA have stated). If source code is really licensed with it, shouldn't they change that? I mean, MIT would likely be a lot better, and wouldn't make it so you couldn't use your software in most open source, free-software projects. CC-BY-SA isn't compatible with the GPL, which poses a big problem considering stackoverflow's popularity. –  Shule Sep 26 '14 at 11:12
    
However, it's interesting to note that although the code is available under the CC-BY-SA, the posters who own the code can release it under other licenses, too. So, someone could give their code an additional license to choose from manually (but the code would still be available as CC-BY-SA, too). So, there's no need to link to code from pastebin or such to keep your own code GPL-compatible. Here's a quote from the CC-BY-SA license: "… Licensor reserves the right to release the Work under different license terms …" (But the additional licenses can't revoke the CC-BY-SA license.) –  Shule Dec 9 '14 at 21:42
    
@ruffin, So how would you define "fair use"? Is copying a function off a page considered "fair use"? What if we repeat that by x10 or x50 on different pages? –  Pacerier Apr 12 at 12:22
1  
@Pacerier For x10-x50: IANAL, and neither is Techdirt, but, for example, "Pastiche without a specific point to make—a collage or mashup--can also be a fair use." I think someone'd be hard pressed to win a case against you if you had a significant codebase with 10-50 snippets from different SO posts (or a codebase artfully created with only SO snippets). That said, again, IANAL, this doesn't constitute legal advice, this is why I Unlicense my SO code, and why I wish SO would change their license. –  ruffin Apr 12 at 22:50
    
@ruffin, I've heard that there are problems with Unlicense, that it's just a toy and doesn't work in any legal sense. –  Pacerier Apr 13 at 12:20
    
@Pacerier Interesting link. Looks like it might have issues in "non-commonwealth" states, like Germany and Japan. What Rick misses (or doesn't care to argue) is that the Unlicense's "salad" attempts to handle such cases. Idk. IANAL. The Unlicense's "stated" intent seemed an improvement over CC-BY-SA to me. Key for me is that the CC license isn't meant for code, so I dual-license SO posts w/ a license that's better than CC-BY-SA. –  ruffin Apr 13 at 17:53
1  
@ruffin, True, CC doesn't seem to fit nicely when used for code (unless CC0). But I believe it can stand in courts. Things will get interesting when someone (in the future) links to actual precedent cases. –  Pacerier Apr 14 at 7:28

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