Posted By: sushovande | Sep 25th @ 5:29 PM
page 1 of 1
Comments: 9 | Views: 656
sushovande
sushovande
Smiley Face Sharp

I was thinking of releasing the small snippets of code I wrote and posting them on my website.. what license should I use if I want to allow free commercial use with attribution?

I want something like CC-BY for code.

RoyalSchrubber
RoyalSchrubber
One. How many time travellers does it take to change a lightbulb?

Old 4-clause BSD license is what you are looking for, but I think more will be turned away by it because:

 

1) Companies don't want to credit you in their brochures/documentation/about dialog boxes.

2) If everyone did that programs would  consist 50% of copyright attributions.

 

http://en.wikipedia.org/wiki/BSD_licenses#UC_Berkeley_advertising_clause

PaoloM
PaoloM
Hypermediocrity

You could use the classic MIT license - as it is fairly simple - but you don't have to use all of it. Add or remove anything that you don't find "right" for you and be happy.

 

Here's the template for the current MIT license:

 

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

 

This is what I use normally for my projects.

I'm with Paolo when it comes to using the MIT license... however I use a tweaked one which adds the following limitation:

     * This code may not be used with or within any modules or code that is 
       licensed in any way that that compels or requires users or modifiers
       to release their source code or changes as a requirement for
       the use, modification or distribution of binary, object or source code
       based on the licensed source code. (ex: Cannot be used with GPL code.)

sushovande said:
But why would you stop people from using your code in GPL-using projects?

Generally so you can preserve the freedom to use the code as people want.

RoyalSchrubber
RoyalSchrubber
One. How many time travellers does it take to change a lightbulb?

Alternatively you can license your code under some other open source that is incompatible with GPL like Mozilla Public License or Common Development and Distribution License. Advantage of this approach is that you have a license that is widely used in FOSS community and at the same time don't appear to be actively acting against other FOSS players (FSF/GPL). Both licenses (MPL and CDDL) are compatible with proprietary and open source licenses with exception of GPL. 

ManipUni
ManipUni
Proving QQ for 5 years!

Because GPL is copyright. MIT, and BSD attempt to make code freeware.
Plus GPL is viral. LGPL is less bad but either way there are far safer alternatives. Apache's license is also good.

dahat, while I respect what you're trying to do by adding that, it contradicts the concept of freeware. You cannot say freeware unless XYZ. That is the moral blackhole the GPL has found its self in by trying to make it free but add a bunch of clauses and "if but when" to the license.

Bass
Bass
www.s​preadfirefox.c​om/5years/

For small snippets I would use MIT license (or public domain). The difference between PD and MIT license is MIT licenses requires attribution and also has a disclaimer of warranty. PD does NOT require attribution, PD is literally "no restrictions".

 

So you'd probably like the MIT license.

page 1 of 1
Comments: 9 | Views: 656
Microsoft Communities