Skip to main content Accessibility Feedback

Copyright, code, and open source

Last week, a reader asked me why I put a copyright and license on every piece of code I publish—even absurdly simple little helper functions that someone else has almost certainly also come with independently.

The reason is both simple and absurd: in the US, copyright is automatically assigned to all creative works, including code, as “All rights reserved.”

Accordingly, if I share my code without a license, you can’t actually legally use it. This is a particularly huge deal for people who work in corporations and agencies and want to use my scripts, plugins, and helper methods.

When I first started doing this, I learned that in the US, there’s no legal ability to put creative works into the Public Domain. That status only happens after your copyright on works expires. You can’t push your works into it sooner.

So… I use the MIT License, which I like because it’s super short, written in mostly plain English, and widely used. And perhaps more importantly, it’s very open and gives people a lot of freedom to use my code. It’s the closest thing I could find to the Public Domain other than the WTFPL, which I originally was using but felt would alienate corporate users.

Another key takeaway from this: if you’re sharing code for others to use, find an open source license you like and add it to everything.

There are many options, and it’s confusing, so I personally recommend MIT.