Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Should every piece of code put online have a licence with it, or should it explicitly mentioned that it is in the public domain?

I'm writing a simple python script that will take a project euler problem number and save a file with the question text as comment. As I was creating the directory and initializing git I added a licence file, which got me thinking is it even necessary to put a licence for something so simple.

So, should every project no matter how trivial have it's licence explicitly mentioned or is it just overkill to put a licence with such small scripts? What is the recommended practice here?

share|improve this question
up vote 11 down vote accepted

I would recommend including a license. It may seem to be unnecessary overhead and not every piece of code is a patent-ridden court case in the making but many people and organizations, large companies in particular, are very careful about other source that they use. Even if is just a quick cut and paste of the BSD or MIT licenses (two short, very open licenses), it just clarifies the author's intentions.

share|improve this answer
Thanks, that clears it up. – elssar Jan 1 '13 at 14:45
Remember a licence protects the user - not you. With no 'licence' you own the code and the user has no rights to it. By adding BSD (etc) you still own the code but give them rights to copy it – Martin Beckett Jan 1 '13 at 15:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.