Your interest in making your computational work reproducible may be entirely personal: it’s more efficient and trustworthy. But ideally you will choose to share the data and code that underlies your work, so that others may share a similar level of trust in the results, and so that they may further explore, learn from, and expand upon your work.

If you distribute software (such as the basic scripts for the analyses in a paper), it is critical that you choose a software license and make that license clear.

Software licenses are about two things: copyright, and protecting yourself from being held liable if your software screws something up somewhere down the line.

In the US, copyright is automatic, and it gives you exclusive rights to copy your code. So if you don’t choose a license for your software, no one else can use it!

So, pick a license, any license.

There are lots of different software licenses to choose from. That’s part of why this is such a painful topic. (That they are almost all really boring to read is another part of the pain. The WTFPL is one of the few that is not boring.)

Personally, I choose between the MIT license and the GNU General Public License (GPL). The MIT license is among the more permissive. The GPL is “viral” in that it extends to derivative works: software that incorporates code that was licensed under the GPL must also be licensed under the GPL. So I use the GPL if I have to (that is, if I’ve incorporated others’ GPL code), and I use the MIT license otherwise.

Don’t use a Creative Commons license for software

An important thing to remember: don’t use a Creative Commons (CC) license for software. Creative Commons licenses (like CC-BY) are great, but they’re for things like articles, books, and videos, but not software. As they say in their FAQ:

We recommend against using Creative Commons licenses for software.

Use CC licenses for your lecture notes, slides, and articles, but not for your software.

What about CC0?

CC0 (public domain) seems appropriate for software: you’re just saying that anyone can do anything with the code.

But in some states (e.g., Maryland, I think), software is treated as a “good” (like a car), and so if your code causes something terrible to happen, you could be sued for damages. Using a lenient license, like the MIT license, eliminates that potential problem through the “no warranty” clause.

So, use CC0 for your lecture notes, slides, and web sites, but use a lenient license, like the MIT license, for your software.

Indicating your choice

So, pick a license, any license. And then indicate your choice, either in a ReadMe file with your project, or in a separate License file, or both.

With the MIT license, I would include the full text, filling in your personal details.

With the GPL, take a look at these instructions:

the process involves adding two elements to each source file of your program: a copyright notice (such as “Copyright 1999 Terry Jones”), and a statement of copying permission, saying that the program is distributed under the terms of the GNU General Public License.

That’s it! Now consider the resources page.