When publishing your data and code, it's
crucial that you apply a license. A license is a document that acts as your official permission for others to do, use, or own something that you are the
copyright owner for (like code you've written, or data you've gathered). It's a crucial part of scholarly communications -- your colleagues need to know exactly how they can use your materials, and you can establish boundaries that you are comfortable with. Releasing your materials without a license creates ambiguity. No one can use your work if you do not include a license, because the implication is that you have reserved every right (including to copy or modify your code) for yourself. To reiterate:
if you do not include a license, no one can legally reuse your work, whether or not you post it publicly. Many grants and journals require code submitted as part of a data-sharing mandate to include a license, as does the NYU Faculty Digital Archive.
The MIT License and BSD Licenses are some of the most commonly selected licenses for open source software. These permissive licenses allow for largely unrestricted use of the licensed software, while releasing the creator from liability for anything that results from use of the software. Another option is a "copyleft" license (GPL or LGPL), which indicates that someone who reuses your code must release their work under the same open license you've used. You can choose a license that you are comfortable with -- there is no one-size-fits-all solution. We recommend that you read some of our resources on open source licenses to understand the differences between them.
Resources