For most spare time projects, licensing can be an afterthought. Personally, I hardly put licences on anything I write. Most of the time this is just because I expect people to use it anyway. I treat licences more as a restriction than a freedom.
Really, if you don’t put a licence on your code then people can’t use it but if anyone asked I would probably let them. A licence should let them know whether they can use it without having to ask you.
However, anything serious that you release needs a licence. Choosing the right licence for your project can be time consuming and involve reading and completely understanding legal documents, which isn’t what most of us want to do. It is very common for people to release code under the GNU General Public Licence (GPL) or Lesser General Public Licence (LGPL).
Terms such as “derived works” and what constitutes these are even more of a problem.
There are a few key points around releasing under these licences. Please bear in mind that I do not have a legal background.
- Anyone is free to distribute your work, even if you have sold it to them.
- You must provide source code for anything you release.
- Anyone is free to modify your work.
- If you use code licensed under the GPL in your project, your project must also be licensed under the GPL. This means that for people not releasing under the GPL, your code is essentially useless and to all intents and purposes does not exist.
The first point here makes selling your work difficult. Even if you successfully sell it, anyone who has bought it can just give it away for free.
The second point here makes releasing closed source binaries a problem. Anything you release must be released with accompanying source code. This causes further problems for commercial software, as attempts to safeguard it against piracy can be easily removed, which is also legal by the third point here.
The third point means that people can effectively take what you have done, make slight changes to it and pass it off as their own work.
However, the fourth point here is the biggest problem. When you licence under the GPL, you are not only causing the above problems for yourself (which may be ideal for you), you are also forcing anyone who uses your code to have all the same problems (which probably won’t be ideal for them). If they don’t want these problems in their own work, they can’t use yours. Fortunately there is a solution for this. The LGPL varies from the GPL in that projects don’t have to use the same licence as you in order to use your code. This makes it ideal for freely releasing libraries that anyone can use.
Somewhat worryingly, FSF and GNU are trying to trying to get people to use GPL instead of LGPL and, it seems, the only reason they are doing this is to give “free” software an advantage. I don’t agree with this ethically. For free software to be free, everyone should be able to use it and that includes people who want to use it in commercial projects.
I’ve lost count of how many times I’ve found a nice little snippet of code that does exactly what I want and the author seems to want to release it to the public for everyone, but has released it under the GPL making it unusable in a non-GPL project.
There are many other licences out there to choose from, such as the MIT and BSD licences. So, please choose the licence for your project carefully and think of the consequences for your target audience before blindly slapping a GPL sticker on it.