2

I'm pretty new to programming, and I've just started using GitHub to store and hold my source code (I keep losing stuff stored locally). As it stands all that's in there right now are source code files, nothing more, but I expect that to change as time goes on and I get better at this. Given that all the repositories in the free accounts are public, how much do I need to worry about licensing?

Would I be fine with just downloading a copy of the GPL, placing a copyright notice in the Readme and calling it a day? I'm fully aware that people can download and modify my stuff, and I'm OK with that, but I at least want to ensure that I get credit for my work should they decide to do so.

  • 2
    "Given that all the repositories in the free accounts are public, how much do I need to worry about licensing?" -- have a look at Is licensing required for public repositories? By default, no one has any rights to your code -- even when you share it publicly -- except for the very narrow rights specified by the Github TOS. If you want to share your code and receive attribution when it's reused, virtually all major permissive licenses (BSD, MIT, Apache) will do this. – apsillers Oct 7 '13 at 16:31
  • 3
    Well, if you're gonna publish things under license X, you better understand what that even means. If you have misconceptions about what the license of your choice requires and allows, it'll (maybe) all end in tears. Been there seen that. – user7043 Oct 7 '13 at 16:32
  • possible duplicate of Can you change a license once you pick one? – gnat Feb 6 '15 at 15:01
5

TL;DR: yes, you should be concerned about licenses, unless you agree to give your code away; the latter is perfectly valid.

If you choose GPL from the start, you're relatively fine, since you yourself will not be bound by it and will be able to re-license your code under different terms.

OTOH if you accept substantial chunks of GPL code by other developers into your project, you'd have to get their agreement if you were ever to re-license the whole codebase. This can become quite problematic.

If you start with a less-binding license, like MIT or BSD, you'll be able to fork your code into a GPL or commercial product, since these licenses allow whatever use (they mostly limit authors' liability). Note that parts which were under MIT/BSD license before relicensing under GPL will stay under MIT/BSD afterwards (for all I know).

GPL also has a well-known limitation: if you statically link GPL code to other software, that other software must be licensed under GPL, too. LGPL lifts this restriction for library code, so if you're developing a library, consider LGPL before GPL.

If you want to forget about licenses completely, you can offer your code as public domain: absolutely zero strings attached, and zero liability. Some projects, notably SQLite, thrive in such circumstances.

  • 2
    The terms of the license are also important if you're only publishing your own license. Some people are not okay with some things allowed by (for example) the GPL. Also, other people will be bound to that license, and many people can't or won't use code under (again, for example) the GPL, so these people won't be able to benefit from your code - you've got to decide whether you want that and whether you have sympathy for their reasons. – user7043 Oct 7 '13 at 16:51
2

Since the repositories are public, it is especially important to put a license on your source code. By default, all works are "all rights reserved", so anyone who finds your repository is not allowed to do anything beyond read it.

If you are okay with the terms of the GPL it is very easy to apply the license to your program. Simply follow these guidelines from the FSF. In addition to putting a license file in the project, they also advise adding a copyright notice and your contact information to each file and including an option in the program to display license information.

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.

Copyright (C)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type show w'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow c' for details.

The hypothetical commands show w' andshow c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.

You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/.

The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html.

  • "If you are okay with the terms of the GPL it is very easy to apply the license to your program." In keeping with delnan's comment above, are there any resources that explain, in layman's terms, what exactly the GPL does and doesn't allow? I'm not too great with legalese (hell, Python was hard enough :-P), so can you recommend any materials that can help me better understand the GPL? – Enrico Tuvera Jr Oct 7 '13 at 16:42
1

Two main points to start with:

  1. Licensing != Copyright (read as "licensing is not equal to copyright")

    • (Software) Licensing refers to how others may use the code and / or binaries. "Others" means people who don't own the copyright to the code.
    • Copyright refers to who owns the code. Check out the Berne Convention for a modest primer on copyright. In this case, since you wrote it then it's your code and you own the copyright to it. Copyright can quickly become thorny depending upon employment, contract, IP agreements, etc...
  2. If you post your code publicly, some people will steal it (if it's any good). And that's regardless of the license you place on the code. Most people, however, will honor the license you place on your code. If you use a particularly onerous license though, then more people will be tempted to steal it.

    • GPL tends to be more onerous than others like BSD, MIT, Apache, etc... But that's a matter of personal opinion. Commercial / for-sale licenses are even more onerous.

To answer your direct questions:

  • No, you don't need to worry too much about licensing your code at this point. It's unlikely that your early code will be of significant value to others, so no one else will be able to use it. And that's not a slight on you, we all started from the same place.

  • As you get more experienced and your code quality improves, then yes, you'll need to worry about licensing. Why? Because others will want to use your code.

  • You do need to worry about the licenses of other projects that you may incorporate into yours. First, their license may or may not permit you to use it the way you want to. Second, they may have picked a viral license like the GPL which will force your project to be GPL. That may be okay, that may not be.

  • I would discourage a knee-jerk "slap GPL on everything" type reaction to licensing. GPL has some persistent aspects that may discourage others from wanting to use your code. And the terms of the GPL may not meet your future needs very well.

  • For now, I would stick with "all rights reserved" for your (non-)license and focus on getting better at coding. Worry about licensing when others will want to use your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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