by Dj Walker-Morgan
Picking a licence for code you have developed should be a carefully considered decision, doubly so for code you want people to reuse. You should take a close look at what's involved in order to make sure your intentions are reflected in the licence you select.
Last year, a coder asked me for advice on what licence to use for his application. As always, I asked the primary question which should be born in mind when selecting a licence: do you want to make sure the software stays freely available in all its modified forms, or are you happy for it to be taken by anyone?
This is the permissive versus copyleft question, and it has been discussed philosophically many times in the past; permissive licences embody a belief that economic and human desires will maintain the code in the commons as a shared resource which can be taken from, exploited and optionally, returned to the commons. Copyleft licences embody a belief that things will only be improved in the commons if those who take from it are required to return all their changes made in the process of exploiting it back to the commons. Examples of copyleft licences are the GNU GPL (General Public Licence), LGPL (The Lesser GPL), MPL (The Mozilla Public Licence) and EPL (The Eclipse Public Licence).
In this particular case, the answer was that they wanted a permissive licence, and the author selected the MIT licence for his code. The author was happy, added the licence text and began distributing his code for all to use.
Time passed and the author continued enhancing his application until one day he wanted to use a particular set of algorithms and data. In the process of hunting for the data, he found a library which included both ready to use. But he wasn't sure about the licensing issues, for this library was under the GPLv2, a copyleft licence. Now, this is where one of the great myths and hard realities of the GPL comes in. The oft-repeated claim that "The GPL is viral"; to be viral, something has to spread without any particular intervention or indirectly through an unrelated action. You can't "catch the GPL" if you have GPL code around. But, and it is a big but, as soon as you start to use GPL code with code under another licence, then you have to move to licence the whole program under the GPL.
You can't actually do this with all open source licences either, only those which are described as GPL compatible. GPL compatible means that a licence doesn't contain any requirements which would be contrary to those of the GPL. For example, the MIT/X licence, New BSD licence and LGPL are GPL compatible. But, as a counter example, the Eclipse Public Licence, the Affero GPL and the original BSD licence are incompatible. The EPL has requirements about how patents are handled, the AGPL is based on the GPLv3 but adds a requirement that if the software is made available over a network, then licence clauses about making the code available come into action. (Clarification: As a reader pointed out the AGPL3 is compatible with the GPL3, but only the GPL3 thanks to mutual clauses in both licences; the AGPL3 is though GPL2 incompatible). The original BSD licence simply required that the authors of the code be credited, but this is an additional requirement and so incompatible with the GPL (which is why the later BSD licences were developed which are GPL compatible).