Considering changing license of Code Snippets Database snippets

I'm considering changing, or more accurately clarifying, the license that applies to the snippets in the Code Snippets database.

At present the code is covered by this rather vague statement that is written to the top of any unit generated by CodeSnip or the online database reader app:

 * This unit may be freely distributed and used on the condition that this
 * comment is not removed from the unit.
 * ...
 * The source code contained in this unit is made available on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. The code is used
 * entirely at your own risk.
 * ...

While a slightly different statement appears in any exported snippet: here's an example:

 * This code snippet was generated by DelphiDabbler CodeSnip Release 4.8.5 on
 * Sat, 01 Feb 2014 14:02:09 GMT. It is made available on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. The code is used
 * entirely at your own risk.

And the CodeSnip about box just says:

The source code in the database may be used freely, but is made available on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. The code is used entirely at your own risk.

At first sight dedicating the code to the public domain seemed a good choice but, from what I've read, there are risks with this. What is more, public domain is not a license and isn't approved by the Open Software Initiative.

OK, not public domain then, so which license to use? I want to satisfy the following criteria as far as possible:

  1. The open source nature of the code should be protected - no-one should be able to make it closed source.
  2. The code should be compatible with as many open source projects that use other licenses as possible.
  3. The license should be as permissive as possible without contravening points 1 and 2.
  4. There should be a disclaimer of warranty (as publisher I want some protection!)
  5. We shouldn't add to the problem license proliferation, so no custom or obscure licenses.
  6. Minimum onus should be placed on the user for making source code available or for giving credit - these are only little snippets of code after all.

Because of item 2 above, I've rejected any of the GPL/LGPL, strong copyleft, licenses because they're viral and mean the code can't be used with many other popular open source licenses. Conversely, item 2 also requires that the code must be able to be used in GPL/LGPL projects.

Having reviewed several popular licenses I think that the MIT License (a.k.a the X11 license) meets my criteria the best: it's very permissive, compatible with the GPL etc., disclaims warranty and is not too onerous to comply with.

I'm proposing to make the copyright statement read "© Peter Johnson ( and contributors".

Note that this proposal applies only to code currently in the database, all my future contributions, and that submitted using the CodeSnip Code Submission Wizard. In future I am planning to let contributors specify their own license.

Any comments welcome. In the absence of comments I'm proposing to roll this out in March 2014. Update: Well not March then, since it's now Sept and I still haven't made the change!


  1. Anonymous2:28 pm

    MIT sounds good but criterium 1 and 2 conflict IMO. MIT does allow you to make the snippet closed source but I think the only alternative would be GPL/LGPL etc which I don't think would be good for the same reason you give.

  2. You're right, points 1 and 2 do seem to conflict!

    I take your point about the possibility of close sourcing with the MIT license. But although a user can close source their copy of the code, at least my copy remains open, so no user can prevent open source copies from continuing to be available, which is something that *could* happen if the code was PD.


Post a Comment

Comments are very welcome, but please don't comment here if:

1) You have a query about, or a bug report for, one of my programs or libraries. Most of my posts contain a link to the relevant repository where there will be an issue tracker you can use.

2) You have a query about any 3rd party programs I feature, please address them to the program's developer(s) - there will be a link in the post.

3) You're one of the tiny, tiny minority who are aggressive or abusive - in the bin you go!


Popular posts from this blog

New String Property Editor Planned For RAD Studio 12 Yukon 🤞

Multi-line String Literals Planned For Delphi 12 Yukon🤞

Call JavaScript in a TWebBrowser and get a result back