Hacker News new | ask | show | jobs
by rectang 3286 days ago
MIT license is good, but I always wish that sample code was available under CC0 -- and presented with explicit permission to copy and paste without preservation of notices. (A request to link back optionally when practical is fine.)

That makes it easier for sample code to achieve the ends of maximum code reuse and popularization of the underlying technology.

1 comments

Agreed. I once tried to submit a small snippet I found on stackoverflow to an open source project. Stackoverflow user content is licensed under creative commons, cc-by-sa (see https://stackoverflow.blog/2009/06/25/attribution-required/). I included attribution, but it was rejected. I totally understand why. CC0 is much preferred in this case.
Your anecdote also emphasizes the requirement for open source projects to maintain rigorous intellectual property policies. Good on both you and the project for the appropriate handling!

Clean IP history is especially important for "universal donor" sample code intended to be copy/pasted. If there turns out to be an IP violation in library code, with luck it may be possible to excise it from the library -- and hopefully not too many downstream will have forked it. But when code is copy/pasted, the linkage is severed and the damage becomes increasingly difficult to repair.

For those reasons, I'd prefer to see something like a contributor list of public identities for collections of sample code, so that it is transparent who is making the licensing promises.

FYI, newer Stack Overflow code is licensed under an MIT license with a link in code comments serving as attribution. See https://meta.stackexchange.com/questions/272956/a-new-code-l...
Looking at that link I don't think it was implemented. The footers on stack overflow pages still indicate cc-by-sa.
Why was it rejected?
Though I don't know the specific project, I can tell you that it is common for projects to reject contributions under licenses that cannot be subsumed by the project's main license.

For example, if a project under the Apache License 2.0 were to accept a contribution of CC-BY-SA code, the complete product could no longer be available under the Apache License (and other licenses with similar terms) -- causing problems for downstream consumers.