Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I recently wrote a little CLI Hangman game in Python; it's not anything huge, but I did write it all myself. I would like to keep the program open and free (GPL ver.3), but it's so small I don't know if I need to/can license it.

Is there a certain point where a program becomes "license-able", or can I license any program I write?

share|improve this question
I do not have anything to add as far as an answer goes, but here is my two cents. I wish there was an open source license already written geared toward academic use. That is, protect the author's copyright, but allow people to distribute and modify the program for learning purposes: programs such as the one you wrote typically fall into this category. I guess the GPL would fulfill this desire, but it is a huge wall of text that does a lot more. –  Snowman Mar 4 at 18:29
@JohnGaughan: I agree with the ideal here, but I would think "for learning purposes" is just too broad. E.g., I could study some code over and over, and then just rewrite it for my evil commercial app. –  phresnel Mar 5 at 8:00
@phresnel I agree it is too broad, I meant that as the goal of the license. Keep the code open, but restrict it from commercial purposes and disavow liability since the code is not meant for serious or production use. However, one can never truly prevent black box re-engineering, not that a little hangman game or other academic endeavor is worth it. –  Snowman Mar 5 at 15:03

2 Answers 2

up vote 10 down vote accepted

You can (i.e. you are legally permitted) to put a GPL license on any piece of software that you wrote, no matter how trivial it is.

A license only has real meaning with respect to your rights if you are willing to try to enforce it. That means that you need to track down people who violate your rights, and try to get them to stop, ultimately by taking them to court. For a sufficiently small program (i.e. trivial), it is simply not worth your effort to do that:

  • The chances that nobody who matters1 will bother to violate your rights in a way that matters in the first place. (Your program is trivial, and could therefore be trivially replaced with a program they wrote themselves ... assuming that it was worth using.)

  • If they did violate, and you discovered this, it would cost you money to sue them. (Lawyer's fees, court costs, discovery costs, etc, etc.)

  • There is a significant chance that your lawsuit would be thrown out on "Summary Judgement" ... where the Judge basically decides that you cannot sustain a case on legal grounds. (For example, that your program doesn't contain the minimal amount of copyrightable content.)

  • If you do get to a trial, here is a significant chance that you will lose anyway, unless you can convince the judge or jury that your trivial program is worthy of protection.

  • Even if you win, it is likely that you will only be awarded trivial damages ... leaving your out of pocket for all of the expenses you incurred.

In short, it is not worth suing over a "trivial" program. (Use your own judgement to decide what is trivial ... in this context.)

So that means that slapping an open source (or closed source) license on a piece of trivial software makes no material difference in terms of protecting your rights.

On the other hand, if your aspirations for your software are altruistic, putting an explicit (open source) license on a piece of software does make it clear to potential users of your software what their rights are. If you neglect to include a license, some future user may be left in the awkward position of not knowing your intention, and not being able to contact you to ask permission.

I've encountered situations where I wanted to include a worthy bit of code into a larger open source project, only to discover that the author hadn't put an explicit license on it, and either wasn't contactable, or wasn't interested in clarifying the situation by stating what the license was. Net result - it was too risky to incorporate the code in the project.

(Legally, the default position is that copyrightable material is copyrighted by the author(s) and permission to copy is NOT granted.)

1 - That is, some person, company, organization who has enough resources to be worth suing. Suing someone with no money means you won't get a payout, and you are liable to be labelled a bully and a copyright troll.

share|improve this answer
You should add a big IANAL-type statement in your answer. –  Radu Murzea Mar 4 at 18:48
Licenses involve more than the authors rights. If you want others to be able to use your code, you need to include a license; otherwise any law-fearing person or entity will not use your code. For example, I found some useful source code on github but would not use it because there was no license giving me permission to use it. I contacted the author who had intended for others to use it and promptly added a MIT license at my request. –  Buttons840 Mar 4 at 19:27
"I contacted the author who had intended for others to use it and promptly added a MIT license at my request." - My experience was different. Then I contacted the author of the library I was referring to, the response was essentially "I don't understand licenses. Go away.". Basically, research scientist get zero credit for writing code, and are often unwilling to put in any effort or thought once it has achieved their ends. –  Stephen C Mar 6 at 10:03
@RaduMurzea - that would be redundant. A real lawyer would not post here :-) –  Stephen C Mar 6 at 10:15

If you do not license your code, no matter how small, it is by default protected by Copyright law. This means that, unless it falls into a very small and specific set of use cases, people won't be able to reuse or redistribute your code without your express permission.

You're potentially asking two questions by suggesting a copyleft license such as GPL v3 though, because it implies that you have two intentions:

  1. To provide your code free for use for any purpose, provided that
  2. Redistributions are also offered under a similar license

The first can be satisfied by any open source license, and it's definitely preferable to none, because without any, it is effectively under "all rights reserved". People who don't want to be on the wrong side of the law will see "no license" as a huge red flag and they'll keep clear of your code.

The second has practical problems as Stephen mentioned, since for trivial pieces of code, it is extremely difficult to spot let alone prosecute offenders of your license, i.e. those that redistribute your code without also offering it under a compatible license, so you cannot guarantee that no one will infringe.

share|improve this answer

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.