Using code libraries in your projects
A code library is a compilation of code originally written for a particular software application that can be used in other applications. At the Church, any code that developers have not written themselves while working on Church applications is called a “code library.”
Using a code library is one of the most popular ways to reuse content created for the web. After all, a lot of different applications are released every day, but many of their essential functions are the same. A code library offers developers a shortcut. Rather than write all code from scratch, you can simply borrow the existing code that others have written and spend more time refining unique parts of your app.
For example, if you are developing a photo album as part of a mobile app for a touch-enabled phone, you can get a code library that allows you to resize images by using a pinching motion with your fingers. Code libraries can be used for simple functions, such as changing the font, or for complex functions such as multi-step financial calculations.
By the nature of their use, code libraries are inherently shareable content. Developers often reuse code libraries freely and pass them on to whoever can find a use for them. Some make the code they’ve written available for download online. Others grab code from an application they are currently using or one they worked on previously.
Restrictions in using code libraries
Because of the ease by which code libraries can be used, it is easy to forget that programming code is somebody’s intellectual property. All code is inherently copyrighted, and as such, shouldn’t be treated any differently from the text in a book. It is the original creator’s right to profit from his or her creation. Thus with many code libraries, attribution isn’t sufficient; you must pay a licensing fee to use the code. Using code without regard to the creator’s rights is both illegal and unethical. It can get “borrowers” and the organizations they work for in serious legal trouble.
Fortunately, code borrowers can legally obtain some rights to use a code library through a license. A license is a terms-of-use document that permits certain uses of the code, based on the terms contained in the license.
The Creative Commons license is one example of a common license and is an excellent example of the varying levels of restrictions that can be imposed on borrowers of content.
Customized by creators based on their needs and preferences, a Creative Commons license dictates whether the code you borrow can be used for commercial applications or strictly for non-commercial applications. It can allow you to modify the code you have borrowed, or it can restrict your legal ability to make any changes at all.
In general, licenses cover the following terms:
- Who are the parties to the agreement
- What content is being licensed
- When is the license valid (start and end dates)
- Where can the content be used (worldwide or restricted to a particular location)
- What restrictions are placed on the license
- How much money or compensation is granted to the licensor
Even with a clearly written code license, abiding by all the terms of the license can get tricky. Since licensing is not standardized, a license may be as simple as an e-mail from the author of the code authorizing you to use it, or it may be a dedicated page on the website where the code library is located. A license can even be in the form of a spoken agreement with the author, but it is best to confirm the license in writing to avoid any misunderstandings.
Because the terms of a license can be as unique as the content being licensed, in some cases the terms of different licenses will conflict, and you will need to either find a different code library or write the functionality yourself.
Note: If you need to license content from a specific creator, the Church has some standard agreements you can use. Contact ICS Communications at email@example.com for details.
Regardless of the way the license is presented, be sure you understand the license’s limitations. Improper use of licenses can cause lengthy delays in your project, since the Church’s Intellectual Property Office (IPO) must validate the rights to every code library used in the project. Per Church policy, all applications must be reviewed by the IPO before they are released. Delays often occur when:
Appropriate licenses for the code libraries in the project are not used correctly (or not obtained at all). The code libraries are not submitted for review to the IPO until the end of the project. A good habit that project managers should develop is to submit code libraries for review as they are introduced into the project. This best practice could trim weeks or even months from the project development schedule. The IPO can begin the process of analyzing the code libraries while the application or software is being developed. If problems are found in any of the code libraries, both the IPO team and the development team have ample time to implement solutions.
Best practices when using code libraries
In sum, follow these guidelines for the responsible use of code libraries:
Find the license of the code library. Most code libraries are found online. Typically, the license is on the same page as the code library or is linked to from the page (see the following image), but you may have to look around the website for the license. If the license is nowhere to be found, contact the author of the code library to ask for the license, or have your project lead ask ICS Communications for help.
Get it in writing. Even if a license is only an informal spoken agreement, it may still be considered a legal contract under the applicable law. However, to avoid any gray areas in the use of a code library, get the license in writing. An e-mail is a perfectly acceptable example of a simple written license. The preferred method is to use a standard Church contract for licensing content, as this provides the greatest legal protection to the Church. When that is not possible or feasible, you should use the licensing information provided by the code library’s author. If you are unable to do either of these, you will need to contact the author to determine what licensing restrictions he or she places on the work.
Submit the license to the IP coordinator for review. Ask your project manager to submit every code library and license used in the application (except for code that is already included in the Java Stack) to ICS Communications. A complex license can take up to a month or more to review, so it’s important to request a license review as early as possible in the project.
Code libraries can be powerful, time-saving tools. Don’t let them cause unnecessary delays in your project. If you have questions about what is and isn’t acceptable to use, contact ICS Communications at firstname.lastname@example.org.