What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 140 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
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

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