25

I wrote a program in PHP. I want people to be able to use the code to learn from and even include bits in their own apps but I also want to maintain the right to sell it and make it clear that others are not to distribute copies either for free or for profit. I haven't used anyone elses code so I don't have to worry about license compatibility. Which license out there is right for that?

I know I can't stop people from ignoring the license but I just want them to at least know it's there and know they're doing something wrong if they try. I can't find anywhere that explains licenses in plain English and yes, I have tried to read the GNU and BSD licenses but I can't get it. Thanks.

Ok so here are the clarifications other have asked for: I am going to sell this program for very cheap. People are free to use as much code as they want from it so long as they have first purchased the program and they do not profit from my code.

I wouldn't mind if people just took the whole thing and added on and made it better but then people wouldn't be honest and they would just add something on and give it free and then no one would buy my product.

I suppose I should just let people have it and ask for donations. So maybe I should GPL or BSD it.

EDIT: I understand why everyone is getting confused. It is contradictory but the thing about legalese is that everything seems black or white. I'm trying to achieve a gray area. I want people to buy this thing from me, not copy it and give it away to people, and even use parts of it. By "use parts", what I'd say if someone asked me casually would be "just be reasonable". So basically don't use a majority of my code in your work and then totally outshine what I did because you'll have it easy as I did most of the dirty work already! I mean, sure, use my DB connect script in your project, I don't care. OR... use all the code and add to it! But only for personal use and don't you dare start giving it out because I'm going to be making money off this thing and that totally undermines my work. And it'd be nice to show me your additions and I'll give credit but the main thing is don't be redistributing my software that I have to earn a living with. Its hard to put that sentiment into legalese. And I just can't understand all these licenses.

8
  • 2
    +1, but migrate to programmers.se? Programmers's FAQ explicitly states "Software law" as a topic.
    – Nick
    May 27, 2011 at 7:06
  • 3
    Can you clarify what people can and can't do? How would you define a "bit" that I can use in my own app if you want to protect the app as a whole from being redistributed?
    – Pekka
    May 27, 2011 at 7:11
  • 2
    But than it isn't open source...
    – dkuntz2
    May 28, 2011 at 3:06
  • 1
    Software can be perfectly open source when the source code is provided after the purchase but prohibits the user from selling it. Open source doesn't have to mean it's free. One example is BlitzMax. You get the full source code upon purchasing, but you're not allowed to distribute it. Changes can be shared amongst other users in their dedicated forums which are shielded from non-registered users.
    – Htbaa
    Jun 1, 2011 at 14:44
  • 3
    @Htbaa: There's different definitions of "open source" around. One is conformance to the Open Source Initiative's definitions (and likely using one of its approved licenses), and that's the accepted definition around here, particularly when the O and S are capitalized. It would be clearer to say "source-available" or something like that if that's what you mean. Jun 1, 2011 at 15:05

6 Answers 6

14

If you want to give people the source code, just ship it along. If you want them legally prohibited from redistributing it, well, copyright law already does that — you don't need a special licence, just the usual copyright notice. You'll find it contains text to the effect of “All rights reserved” - one of those rights is the right to redistribute a copyrighted work, which your code is.

Of course you can add further text to clarify things if you want, but unless you are an expert you run the risk of accidentally changing the terms in ways you didn't want. As usual, consult an actual lawyer for actual legal advice.

Edit: The FSF have just posted a page specifically for novice licence choosers: How to choose a license for your own work

5
  • What about the right to quote by naming the source? - As the source has been already published by the original author, it's available for various use by copyright. At least "all rights reserved" should be written, but next to that there are higher rights that supersede these "all reserved" by law, isn't it?
    – hakre
    May 28, 2011 at 19:10
  • @hakre: Higher rights that supersede legal rights won't get you anywhere in the typical court. Things like US "fair use" are legal rights (or at least legal defenses against lawsuit). In some places, an author can't waive the right to have his name attached to software. Jun 1, 2011 at 15:08
  • @David Thornley: That are some examples for that higher rights stuff I was referring to. I didn't mean higher rights in the sense of military action for example, that allows forces to take anything they want to due to pure military power, I meant those higher rights that there are through the various laws, some of them supersede copyright AFAIK.
    – hakre
    Jun 1, 2011 at 20:14
  • 8
    That article is highly biased though: it's basically a guide to choosing one of the FSF licenses; the only non-viral license it even mentions is Apache 2.0, disregarding such widespread licenses as MIT, BSD, Mozilla, and Artistic.
    – tdammers
    Aug 28, 2011 at 15:35
  • Almost no one posting on a forum for help with this stuff, can afford consultation with a lawyer. Therefore "consult an actual lawyer" is not actionable advice. Obviously lawyers have the answer. But if they could get that consultation, they would not be posting on a forum.
    – Divan
    Aug 24 at 7:54
5

What you try to achieve looks a bit contradictory to me. Just writing so because it might help you to find where you want to draw the line:

I want people to be able to use the code to learn from

I think learning from code is generally allowed if it's available in public - regardless under which license. Keep in mind that IANAL and that this might differ from country to country. But as a simplification of my opinion, you can not restrict the right of others to learn. So you don't need to explicitly give that right as the public already got it (or from the other side: it has been already given and you can not restrict that higher right).

and even include bits in their own apps

That's the part I stumbled over: Do you want to allow others to copy over parts (which size?) of your code so that they can use it in their own apps? I just ask because you write as well:

but I also want to maintain the right to sell it and make it clear that others are not to distribute copies either for free or for profit

Which would contradict a bit to the point that you as well want to allow them to copy the program (in part).

Basically this comes down to distribution: Do you want to allow others to make use of your code but only for their own private programs? If they make use of your code they are not allowed to redistribute anything that has been in contact with your code at all.

So you don't give them the right to create mix of your code and other code for distribution.

I don't know of a license that has such terms from the top of my mind but I can imagine that something like that has already been done.

However it looks as well like you want to reserve yourself the right to commercially control the software so I assume you have something worth to protect. You should contact a lawyer on your behalf to discuss the detailed needs you have, e.g. the grade of control about commercial use of the program / software. A lawyer can much better explain how a license should be written then and she/he can comment on existing licenses as well for you, so that in the end you should be able to answer your question according to your needs.

0
4

Others have pointed out various licenses you could look at, but this:

make it clear that others are not to distribute copies either for free or for profit.

Means you can't call it Open Source. Point 1 on http://www.opensource.org/docs/osd says

The license shall not restrict any party from selling or giving away the software ...

The right for anyone to distribute software is one of the core components of Open Source.

Because of this, you'll find most open source licenses (like the AGPL someone else suggested) unsuitable.

I suggest you drop that requirement. In fact, I suggest you stop trying to craft a overly protective license. A far bigger problem for anyone is getting interest for their thing, not license terms. Just read up on Open Source licenses, pick one (start by looking at the GPL or AGPL) and go for it. Do not add to the problem of http://en.wikipedia.org/wiki/License_proliferation

Also, look at Dual Licensing which will allow you to release the code as open source and sell it privately. The hard part of that is that if anyone submits a patch, they have to agree to allow you to include it in your not-open-source-for-sale version.

6
  • 3
    "I suggest you stop trying to craft a overly protective license": it's his work, he doesn't have to share it if he doesn't want to. May 27, 2011 at 17:51
  • 1
    "Means you can't call it Open Source": Not true. Open Source doesn't equal free code. See my comment to the OP.
    – Htbaa
    Jun 1, 2011 at 14:47
  • 2
    @htbaa What David says. The accepted definition of Open Source is the OSI one, that's what most ppl think when you say it. If you use it and your license doesn't meet the OSI criteria, it generally looks like your trying to trick someone. Best avoided.
    – James
    Jun 1, 2011 at 16:11
  • 1
    @James: Quite obviously the OP uses the term Open Source in the general sense of "making the source code available", not the OSI definition.
    – tdammers
    Aug 28, 2011 at 15:37
  • 1
    @tdammers But when you say "Open Source" most people think of something that roughly matches the OSI Definition. See many other comments on this Q. OP's use of the term is confusing and more importantly will confuse others later.
    – James
    Aug 31, 2011 at 12:18
4

Check the first paragraph of your own question.

I wrote a program in PHP. I want people to be able to use the code to learn from and even include bits in their own apps but I also want to maintain the right to sell it and make it clear that others are not to distribute copies either for free or for profit.

For a honest developer, these lines are a perfectly valid license.

In other words, you can create any license terms that you want.

3
  • 2
    That link points here. Did you mean his "I don't have to worry about license compability." statement, or something else?
    – Macke
    May 27, 2011 at 7:31
  • 1
    No, I mean: I wrote a program in PHP. I want people to be able to use the code to learn from and even include bits in their own apps but I also want to maintain the right to sell it and make it clear that others are not to distribute copies either for free or for profit. For an honest developer, these lines are a perfectly valid license.
    – mouviciel
    May 27, 2011 at 8:11
  • 1
    Ah. That's true. It just wasn't obvious (to me) from your answer. Smart thinking!
    – Macke
    May 27, 2011 at 9:00
0
I suppose I should just let people have it 
and ask for donations. So maybe I should GPL or BSD it.

so from a strictly practical standpoint a well crafted pay what you want set up (aka donation page) might make you more money, unless you actually expect to make a good amount of money selling it (you said sell it cheap so I don't know what that means, like 20 copies at $0.50 or 500 at $10, more). If it's only like $0.50 I woudln't bother because bear in mind if people pay for it, there is some obligation to support it, if you give it away for free, not so much.

-1

Dual License.

  • AGPLv3 for open source project/to learn from.
  • Commerial License (of your choosing) for non-open source projects.

If it will not be sold, just use AGPLv3 which will make it pretty much un-usable for any major corporations or profit driven that uses closed source.

2
  • +1 For Dual License, which I think is the way to go; -1 for AGPLv3, which I think is precisely the opposite of what the original poster asked for. (Caveat: My knowledge of AGPL comes from en.wikipedia.org/wiki/Affero_General_Public_License )
    – Mark Booth
    May 27, 2011 at 12:10
  • 2
    AGPL does not stop others redistributing it. See my longer answer/rant :-)
    – James
    May 27, 2011 at 13:52

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