Pergunta

I have reviewed/read this page: https://blog.stackoverflow.com/2009/06/attribution-required/

Which is linked from the bottom of every stackoverflow.com page.

How does it work when I want to use a small piece of code, or a [small] idea contributed by someone to stackoverflow, but only in code?

I.e. not "republishing" the content, but simply using the content as a starting point/idea, and maybe re-using the same classes etc.

Would it be ok to do so without attributing every detail?

Thanks!

Foi útil?

Solução

All content contributed by users on Stack Overflow is released under the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license. That page and the Attribution Required blog post cover what you need to do when you're republishing content from a Stack Exchange site somewhere else.

If you're reading code snippets from Stack Overflow and using them to make your software work, then you're using the site as it was meant to be used. (I'm assuming you're not just copy/pasting large chunks of code verbatim. I doubt that would work for 99% of the code on here anyway.) You don't have to disclose this in the user interface or documentation of your product, but it would be a good idea (mostly for your own benefit) to document where that code came from in a source code comment. That way, when you come back to that code for maintenance, you can go back to the original source for any additional information you may need.

Outras dicas

I wish that StackOverflow used a better clearer license for source code contributions, like the MIT license.

Here is my best attempt at how to copy source code from StackOverflow and abide by the CC BY-SA license. If anyone (especially a lawyer) sees a problem with how I'm doing this, I'd appreciate hearing from you.

Put a comment like the following above the copied code:

// The class below was written by StackOverflow user John Leidegren and is licensed
//  under CC BY-SA 3.0 ( http://creativecommons.org/licenses/by-sa/3.0/ ).
// http://stackoverflow.com/a/4634505/386091

Here are the key points that I see from the full text of this license:

  • Section 4(a): include the URL to the license.
  • Section 4(c)(i): give credit to the original author, by name or pseudonym.
  • Section 4(c)(iii): give a URL to the SO source code. (If the source code is in an answer, use the 'share' button on the answer to get a perma-link.)
  • Section 3(b): If you make any changes to the source code, add a comment saying "The original code has been modified."

I think that's it, as far as what you have to do.

I would argue that the copied source code is being added to a Collection in your software project, from the viewpoint of this license. That means that the copied source code is under the CC BY-SA license, but the rest of your source code is unaffected.

I think that copied source code also becomes an Adaptation when compiled to machine code, because the license says in Section 1(a) that translations from one language to another (e.g., English to French) count as an Adaptation. So, the one little bit of the executable would be covered by this license. Section 4(b) says that you have to link to the license as part of every "performance" (meaning when the copied code executes) but that's just not possible with most bits of code; you can't display a message "the code that is executing right now is covered by CC BY-SA" in the nanoseconds it takes most code snippets to run! I don't think you have to describe the copied code in credits, if your software has a list of credits, unless you do it for all code snippets from SO, because Section 4(c) says that you only have to make a listing in the credits if you list all contributing authors.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top