views:

193

answers:

7

I'm a soon to be grad and I'm just starting to work on my personal website. I wrote a couple of small apps that that I would like to use as code samples for potentional employers. I might allow the general public to download and use my apps, and naturally I wouldn't like anyone to just take my code and call it theirs. Do I need to attach a license to my programs? If so, which one would work best?

added

If I choose an open source license, do I need to host my projects on SF, Goole Code, etc. or can I simply have a link on my website to a zip file with the latest version?

+7  A: 

You might want to review the licenses by Category from the Open Source Initiative.

Popular options are the new BSD License (allows any usage, but requires your copyright to stay intact), and the GPL (allows any usage, but puts strong requirements on redistribution).


Edit:

As for distribution - you are free to distribute your code any way you want. You can use an open source license, and keep the code on your website. You can use an open source license and only give out the code via e-mail, if you want. Distribution and licensing are two completely separate issues.

Reed Copsey
I hoped I wouldn't have to read everything off that list, hence the question whether I actually need to use a license. :-)
Craig Grant
That's why I suggested two good options. BSD is probably the best option, IMO, if it's just short and sweet.
Reed Copsey
BSD is very flexible (they pretty much just can't call it their code), GPL is the most restrictive. If you want something in between, let us know specific details of what you want from the licensing.
Reed Copsey
A: 

Pick an open source license. Most will protect the code from being take by someone.

Take a look here.

Jim Blizard
+2  A: 

GPL or Creative Commons would work the best.

Pretty much the only license that let's people do what they want with the code is BSD with a specific requirement to not use authors to promote the derived products, which some people interpret as "I can claim this code as my own". However BSD-derived MIT license is safe in the sense of you use case.

Nick Gorbikoff
The more modern version of the BSD license is functionally identical to several other licenses (including the MIT license you mention). They all say, essentially, "Do anything you like to the code, but leave the licensing and copyright notices alone."
David Thornley
+1  A: 

+1 for having thought of this. It's important discipline. Programs start small and then suddenly this matters.

The major decision is between GPL and the rest. GPL is designed to spread the idea of free software ("free as in speech", not as in "beer"). It's termed "viral" in that any software which uses a piece of GPL'ed software must adopt the same licensing policy. That means, for example, that large corporations such as Microsoft won't use GPL software. The GPL also protects against your code being used in patents (many disapprove of software patents in principle).

Which you choose depends on your political outlook and I won't force mine on you :-)

It is possible to dual license software so that there are Open and Closed versions running roughly in parallel, but you are probably not at this stage yet.

Creative Commons can be problematic for software licences unless you use CC-BY. Best avoided.

peter.murray.rust
I think any copyrighting(any license but Public Domain) will prevent your code from being used in patents without permission(if the copyright exists before the patent was filed)
Earlz
From the GPL site:Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.I have heard RBS talk on this issue and it's his view that only GPL prevents this. It can be difficult to show prior art in s/w patents
peter.murray.rust
I'm not understanding how the GPL can assure that anymore than any other license.
Earlz
@earlz: Releasing code under the GPL often goes with transferring copyright to the FSF (it's encouraged to do so, but by no means compulsory, of course). In that case they have effective legal power to enforce the license terms. Other than that, it's rather theoretical, indeed.@peter: I assume you mean *RMS* ;-)
Arthur Reutenauer
@Arthur Reutenauer: The issue with transferring copyright is that any license is toothless unless somebody will legally prosecute violators. I sure wouldn't have the time or money to prosecute people who infringed on GPLed code I wrote. The FSF will work hard (including legal action, if necessary), to stop violation of the GPL, but they can only do that if they have legal standing, and that basically means holding the copyright.
David Thornley
Ah, ok thats what I figure you were meaning.. yes with the GPL comes the great and mighty FSF on your side..
Earlz
@earlz: Am I detecting sarcasm? (I may not know any better)
Craig Grant
No, they really are quite mighty and he is correct that they will fight any legal battles you have if you have a GPL license.. I didn't mean it to be sarcastic..
Earlz
@David: Yes, that was pretty much my point.
Arthur Reutenauer
A: 

My vote is for BSD. IF you care about every nitpicking thing people contribute or use your code for to be published as open source, then choose the (extremely viral) GPL.

I prefer BSD though because I don't care what people do with my code.. I just want to make sure they don't claim it as their own. If a closed source(or open) project uses BSD code it's suppose to have a disclaimer somewhere telling the users that is used that BSD code and that it is freely available from somewhere.

I would prefer one of the Creative Commons before GPL as GPL is extremely restrictive in the practical sense and forces everyone else to conform to GPL..

Edit: also for the case "do you need a license" the answer is technically no. If you have something and say it was created by you, it defaults to all rights reserved which means no one can actually use it, compile it, or redistribute it or whatever without your explicit permission.. If this is what your going for, then you may wish to add some headers to your code saying "all rights reserved" just to make this more explicit

edit2: (in response to your edit) No, you can host your code anywhere, though choosing an open source license does enable you to be hosted at those places. Basically all you have to do to tell people that your code is licensed is include a "LICENSE" file in that zip file when distributing it with your license.. It's also a good idea to put the license(or a link in the case of GPL since it's pages long) as a header in all of your source files just to make sure everyone knows..

Earlz
A: 

If you don't attach a license, technically they're just under copyright, and nobody but you has the right to modify or redistribute the apps.

Typically, people attach a license so other people can use them more freely. All popular licenses require that the copyright notice be preserved, which prevents anybody from taking the code and saying you had nothing to do with it.

Past that, it depends on what you want people to do with it. If you don't care how people use it, use a BSD-style license. If you want people to have to share their changes if they distribute it, use a GPL variation. Alternately, you might prefer one of the Creative Commons licenses, although I prefer Open Source licenses.

David Thornley
+1  A: 

Here is some advice I can give you as an occasional contributor to open source projects:

Even if you don't care about what people do with your code, it's usually better to attach a license statement, first because it can identify you as the author. Since you want your code to act as sample for potential employers, I suppose that you do intend on identifying yourself as the author (I originally didn't care, and found out later that it was very important to state that I'm the author, see below). Second and more importantly, because as David Thornley points out, if you don't state your license conditions, nobody but you is legally entitled to do anything with the code but you.

This statement can be minimalist; for a project that I'd been having with a friend, we used the two-liner “Copyright 2008 TeX Users Group / You may freely use, modify and/or distribute this file.” (note that here we didn't feel necessary to state that we were the authors, but relinquished copyright to the organization we did this work for). One of our main concerns here was that if anyone was to modify our code, we wanted to hear about it in order to make the user community benefit from it.

This last point should be quite important to any programmer, I think: when I write code I'm proud of, or I feel would be useful to others, I'm always happy to know that someone has been using my code or, even better, has improved it; in that case I'm happy to modify my original code. For one particular sample I wrote once, I have witnessed how half a dozen different people used my code and adopted it slightly, without ever modifying the original code – the link above is a wiki (the code has originally been posted by someone else, but it's been mostly written by me). I found the situation very frustrating and decided from that point on that I would always state that I'm the author, and encourage people to report to me if they've found my code useful (that rarely happens, but that's another problem).

About the license you should use, other people have already explained the issue better than I would. I'd like to add two points, though:

  1. GPL has made incompatible changes from version 2 to version 3, resulting in the odd situation that programs that have been released under GPL v2 can't be used with code distributed under v3. If you do choose GPL, I'd strongly advise the wording “GPL v2 or, at your option, any later version”. I've witnessed how one very big project was having trouble because developers contributed code under “GPL v2” which thus (probably unwillingly) prohibited its move to v3. v1 is hardly an issue, as v2 is 18 years old now. I'm not aware of any project licensed under GPL v1.

  2. (I am not a lawyer, etc. This is based on numerous opinions I've read on mailing-lists.) If you're in the US, you're entitled to state “I, Craig Grant, hereby release this piece of code into the public domain.” In many European countries, though, this makes no legal sense: either you've been dead for over 70 years (your mileage may vary), and your work is, by law, automatically part of the public domain; or you're not, and your work can't be in the public domain. Someone (you, or people you've transferred copyright to) always hold the copyright. Which makes the need for a license statement all the more acute. I've been using my country-fellow's WTF Public License on occasion, but since you want to show your code to potential employers you may not want to refer to such wording :-)

Edit

Re your added section: of course not! The conditions you choose for distributing your work have nothing to do with the place you make it available from. It's much more the other way round: if you want to upload code to Google Code, you have to put it under some open source license. But writing open source code does not force you to upload it anywhere in particular :-)

Arthur Reutenauer