Code in Computing Classes: When CC Is the Wrong Licence
Computing teachers produce a mix of materials: written tutorials, slides, exercises, and a lot of code, from starter files to full reference solutions. Creative Commons licences work well for the prose and the pictures. For the code, Creative Commons itself recommends a different kind of licence. This post explains why and suggests a simple pattern for a computing course that wants to share openly.
Why CC licences do not suit software
The Creative Commons FAQ advises against using its licences for software. The licences say nothing about distributing source code, do not address software patents, and are not designed to work with the licensing conventions of software projects. Instead, Creative Commons points people to free and open source software licences, such as those listed by the Free Software Foundation and approved by the Open Source Initiative. CC0 is the exception: Creative Commons considers it suitable for code, because it simply waives rights.
Common software licences in teaching
| Licence | In short | When a teacher might choose it |
|---|---|---|
| MIT | Permissive; keep the copyright and licence notice | Starter code and small examples students may reuse anywhere |
| Apache License 2.0 | Permissive, with an explicit patent grant and notice rules | Larger example projects or tools |
| GNU GPL version 3 | Copyleft; distributed modified versions must stay under the GPL | When you want derivatives to remain open, similar in spirit to ShareAlike |
| CC0 1.0 | No conditions | Tiny snippets, test data, exercise scaffolds |
CC BY-SA 4.0 is listed on the Creative Commons compatibility page as one-way compatible with GPLv3. In practice, this means BY-SA material, such as a diagram or a passage of explanation, can be incorporated into a GPLv3 project, but not the reverse.
A pattern for a computing course
- Prose, slides and diagrams: CC BY 4.0 or CC BY-SA 4.0, with the usual attribution notice.
- Code examples and starter files: a permissive software licence such as MIT, stated in a LICENSE file and a short header comment in each file.
- Exercise data: CC0, so students can copy it into any project without credit lines.
- A README at the top of the repository that explains which licence applies to which folder.
Repository hosting services read a LICENSE file and display the licence automatically, which helps other teachers. The tutorial on licence notices that software can read explains the same idea for documents.
Student code and third-party libraries
Code that students write for assessments is usually theirs, subject to your institution's rules. If you want to publish student solutions as examples, ask permission and let students choose a licence, as the checklist for accepting student contributions recommends. Libraries that your starter code depends on keep their own licences; you do not relicense them by mentioning them. List the dependencies and their licences in the README, and avoid bundling copies of libraries whose terms you have not read. If a project involves unusual combinations of licences, ask your institution's copyright or technology transfer office, since the details matter.
One last habit pays off: put the licence decision in the course handbook as well as the repository. Colleagues who teach later sections, or who borrow your exercises for another course, then know straight away which parts they can adapt freely and which conditions travel with the code.