Licensing of code snippets

question

#1

I note that the TOS for this discourse site specify

User contributions are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

whereas an implicit MIT license would seem to be the community preference for new code presented here (if possible).

  • What is the rationale for CC-ANS?
  • Should we make a habit of posting code in Github gists or the like (where licensing is flexible) and just quoting or linking here? (That’s awkward, but if it’s what it takes to appease the legal daemons, …)
    • If so, what is the minimal addition to such a gist that provides an MIT license?
  • Should readers feel encouraged to (politely) ask posters of useful code to re-license their own work elsewhere?

#2

Can’t we just change the TOS to say that code snippets are MIT licensed? cc @vchuravy


#3

At the time there was no specific rationale. CC-ANS is used in the default TOS for discourse and so we kept that.
It is important to note that it is recommended that CC is not used for software code https://creativecommons.org/faq/#Can_I_use_a_Creative_Commons_license_for_software.3F.

I would propose to amend the TOS with the following:

Codifying the reality of Julia software, while still permitting for users to choose their own license.

cc: @admins, @moderators


#4

Yes, that sounds like a good plan.


#5

Actually, I’d prefer a license without attribution requirements. Since the vast majority of snippets will be one (or a couple) line responses, I feel like reality and practicality should allow the free copying of such code segments (unless the author expresses a desire to the contrary of course).


#6

Which license satisfies that requirement?


#7

CC0?


#8

Seems so, yes, thanks.


#9

I agree that no attribution requirement or weak attribution requirement is beneficial. Maybe we should take a page from how stackoverflow handles this:

  • Non-code contributions will continue to be available for use under the terms of CC-BY-SA
  • Code contributions will be available for use under the terms of the MIT License
  • You don’t have to include the full MIT License in your code base. Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution upon request of the copyright holder (or Stack Exchange on behalf of the contributor). This optional exception to the MIT License will live in our terms of service.

Apparently when they decided to go ahead to implement their license change the drop the upon request part:

  • You don’t have to include the full MIT License in your code base. Contributors agree to give code users permission to ignore the MIT License’s notice preservation requirement, as long as users give reasonable attribution. This optional exception to the MIT License will live in our terms of service.

I would still go with the original wording.

An alternative to CC0 would be 0-clause BSD or FPL https://opensource.org/licenses/FPL-1.0.0.
The difference is that CC0 aims to explicitly release a work into the public domain and does so by waiving the creators rights, whereas 0-clause BSD or FPL are licenses in the traditional sense and so give permission to everybody else, but do not impact the creators rights.


#10

Snippets less than about 10 lines of code are probably not copyrightable anyway (if I recall correctly from the FSF’s legal counsel, regarding copyright assignments for code contributions).

https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html