I have noticed a few times that people have edited link only answers to include code taken from the linked site. However, anything posted on stack exchange is licensed under the Creative Commons Attribution-ShareAlike 3.0 license, but code on a linked site may have it's own license already.
Not being the copyright owner of that code can we really post it on Stack Overflow and re-license it? Or in this case is a link-only-answer actually the correct answer? Sure you can still write context around a link but it may be impossible to include the actual bit of code which answers the question.
Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.
Update: Examples of sites which are commonly linked to which have licenses for code examples:
- CodeProject with CPOL
- MSDN with MS-LPL
- CodePlex with whatever OSI license the project uses
- Microsoft Reference Source with MS-RSL
- Android documentation and samples with Apache 2.0 license
- GitHub projects and gists
- Any project which has samples on their website
- Blogs also often have somewhere which state the license of code
The point is not whether the code is open source or not or whether people have a right to use the code. The point is that it is not licensed under the CC BY-SA license which is being applied to it. Indeed in most cases the code is licensed under a more permissive license which isn't viral.
And back to the point of link-only-answers, there seems to be a lot of talk about how bad they are (which I mostly agree with) and how to deal with accepted link-only-answers but no one has talked about the potential license issues of including the actual answer in the answer rather than a link to a page which contains the answer.
Update: Other relevant questions to do with licensing although they don't consider link-only-answers.
- How does fair use apply to code snippets?
- What is up with the source code license on Stack Overflow?
Why doesn't SE use a more permissive license like the Creative Commons Attribution license? Would really put a lot of people's minds at ease and not leave things to come down to whether something is determined to be fair-use or not which is not so clear cut.