Do you know if your code is open source?
Do you know if your code is open source?
Do you know if your code is open source?

    Get Involved Today

    Pop quiz: if you write a computer program and post the code online without including a license file, have you open sourced it?

    If your answer was “yes” then you’re in for a surprise.

    As part of my internship work at Public Knowledge this summer, I wrote a small web widget (on Github and on the website) to help users tweet at or call their Congressional Representatives. I was only at PK for a few weeks, so it was important to me that the software code be saved in a public place, like the online code repository Github, so that staffers or later interns could extend and adapt it for later uses. We created a Github account and checked in a copy of the html page.

    Then, I wanted to make sure that anyone—not just future PK staff—could use the code I had written, for a couple reasons. First, I’m a big fan of free and open source software (FOSS). Second, I’m no javascript expert, so I relied quite a bit on jquery tutorials and other example code online in building my widget. Since I learned how to write this tool by looking at code written by other software developers, I wanted to pay it forward.

    In addition to helping others learn how to do something, FOSS—which has been compared to a big, noisy, crowded bazaar—encourages developers to think about their work as a small piece of an overarching collaborative effort. It’s a bit of a free-for-all, but something that enriches all of us through the availability and sharing of so much knowledge. It can also help a developer improve their skills.

    When a software developer opens a repo on Github, the Github software asks what license to apply to the code. Knowing that not all software developers are experts in the minutiae of the various flavors of FOSS licenses, Github provides a fabulous tool to help developers choose a license. They also point out that if code is posted with no license, it will be protected by default copyright law, meaning the developer who wrote it retains the exclusive rights to copy and modify it

    But many developers don’t understand this, so they continue to post code with no license all the time. It’s been my experience as a programmer, with many friends who work on side projects that they would like to share, that the majority of developers assume that if source code is online, then it’s “open sourced.” That’s an unfortunate assumption within the community, because it’s incorrect. For code to be free or open source, it has to be available for other developers to use, modify, and build upon, and under our current copyright system, people can’t just use someone else’s copyrightable code that has been posted without any license.

    So to developers everywhere, please take note: copyright protection attaches the moment you make a “creative work”—no phone call, email, fax, or carrier pigeon required. Copyright attaches regardless of whether you want it to or not, regardless of whether you even know anything about copyright (or care to). This means that as a programmer, you have to voluntarily waive certain rights to your code—like control over reproductions—for it to become FOSS. No explicit license, no waiver. Without a FOSS license, your automatic copyright in the code restricts others by preventing them from reproducing your work. Applying a license to your code signifies that you are waiving certain rights granted by copyright law, and allowing others to use and modify your code under the rules set forth in your chosen license instead.

    When you add a license to your code, you can choose what type of protection to release your code under. Perhaps the free software “free speech” ethos appeals to you. Maybe you’re interested in Open Formats, interoperability, or are concerned about the impact of cloud computing. Whatever license you choose, choose one! The license makes your preferences clear and lets other developers know how they can use and possibly extend your code.

    So visit Choose a License, learn about the differences between GPL, MIT, and Apache licenses, and don’t forget to include one with your code if you’d like other people to be able to learn from and make use of it.

     

    Image credit: PK intern Wendy Knox Everette