Recommended/required license for example code
Open, Needs TriagePublic

Description

KDE's Licensing policy (https://community.kde.org/Policies/Licensing_Policy) currently does not specify what license to use for code which is used with example code or code snippets, like demonstrating the use of some public API, either in API documentation or in separate example programs.

I guess that should be some license which does not require any mentioning of the origin/author, and gives the person copying the code all rights, as if they wrote this from scratch themselves. So something like Public Domain, or whatever is a working license with the same effect.

kossebau created this task.Jun 28 2020, 2:41 PM

As with generated code we might want to spread freedom and make it all GPL

Or we could suggest making it public domain which needs something like "To the extent possible under law, the author has waived all copyright and related or neighboring rights to the work."

adridg added a subscriber: adridg.Jun 29 2020, 3:02 PM

CC0 is the "long form" of Jon's second suggestion; it is unfortunately long and torturous, but also one of the licenses we might have to deal with anyway for "uncopyrightable". It has a SPDX identifier, CC0-1.0 and is also suggested by REUSE.software.

Making examples GPL would be amusing, if we cut-and-paste our own example code into library production code at some point; I don't think that's a good idea.

I think, I would look at this question from the use cases that we have for example code:

  • a developer with an open source project that is compatible with GPL licenses wants to use incorporate our example code -> anything from the above works (CC0-1.0 or any GPL)
  • a developer with an open source project that is incompatible with GPL licenses wants to use incorporate our example code (e.g. Apache-2.0, which is not compatible with GPL-2.0-only) -> maybe CC0-1.0, BSD-2-Clause or MIT is better suited
  • a developer from a proprietary project wants to incorporate the example code (e.g. a developer using the KF5 LGPL licensed libraries and wants to bootstrap using them) -> also in this case CC0-1.0, BSD-2-Clause or MIT should work fine