Copyright protects original literary, artistic and musical works. For the purposes of copyright, computer software is considered as a literary work, even though this is not ideal in practical terms. Copyright law allows a limited proportion of a conventional literary work to be reproduced without permission of the copyright owner (see Fair Dealing and how to copy legally). This may not transfer well to re-using code, if it is necessary for a large proportion, or all of it, to be used in order to work properly.
Software re-use can be beneficial, as it can save time and resources, make projects possible that would otherwise be unfeasible for a student, and, if from a reputable source, it is likely to work better and have fewer bugs than similar code that one can practically develop by oneself. Note however that the responsibility of ensuring that the reused software works correctly in your own product will be yours.
Whilst copying code is subject to the same restrictions as other copyrighted work, it is common for software to be re-used, normally by licencing. There are many different types of licence. The Open Source Initiative (OSI) website has a list of open source licences, categorised into types of use. Licence terms can be read by clicking on the licence. Software may also be licensed by providers.
Note that with most licenses the authors do not give up their moral rights to be identified as the authors. Even in the rare cases in which they do, you must acknowledge their authorship if your reuse is for a submission to the university. All identification of the original authors that is in the code must be kept, and even if the license allows you to modify the code, you must indicate if you have done this. This duty is not limited to comments inside the code, but applies to any mention of code you have written that includes or modifies the reused code.
Are you using openly licensed code? This allows free re-use, without asking for permission. Please note that there may be conditions; for example commercial use may not be permitted. Read the licence carefully to check for restrictions.
This licence allows modification and distribution. Attribution and a warranty disclaimer are required. A warranty disclaimer removes any kind of liability from the original creator of the software. Examples include:
The MIT licence originated at the Massachusetts Institute of Technology. There are very few restrictions on re-use, for example use is permitted in proprietary software, where sharing is not permitted (even though open code has been used).
The Apache 2.0 licence is similar to but slightly more restrictive than the MIT licence. For example, if you have made major changes to the code, these must be described. This licence does explicitly allow users to patent software that includes software licensed in this way.
This licence allows sharing, alteration and re-use of the code (with attribution); but the end product that contains the re-used code must be shared under a compatible copyleft licence - the terms can't be any more or less restrictive. It must also be possible to licence any permissive software used in the product under the copyleft licence.
There are two versions of this licence: v2 (GPLv2) and v3 (GPLv3). These are very similar except that v3 allows users to patent software that includes software licensed in this way.
If you distribute your software, you will need to choose a license that is permitted by the licenses of all software products you have reused. This will need particular care if your product is to be proprietary or have a limited licence (it will probably be difficult or impossible with a copyleft licence). With a permissive licence, this is less likely to be a problem as there are few restrictions on re-use, including applying a different licence to your end product.
If you use a licence for your end product that is not compatible with the licence of the software you have used, this could cause legal problems, especially if your product is to be used commercially.
If using software that is not openly licensed (proprietary), you will have to ensure the terms of the licence that it has permits re-use.
If it does not allow reuse, request permission from the vendor or developer (who may not be the same person or organisation). They may then grant a licence to you specifically, laying out under what terms you may re-use the software. For commercial use, a financial arrangement may be required.
Sometimes software providers will allow APIs to be licenced to allow third parties to create software based on them. This might allow clients to design services that are more tailored to their needs. The licencing may be on an individual basis.
Please note that licensing software with a Creative Commons (CC) licence is not recommended by the Creative Commons organisation.
The reasons for this are:
Although it is not recommended, there is nothing in the CC licences that explicitly forbids licensing code, so you may find code that is CC licensed, and the terms of the licence apply as with any other type of content.
A notable example is stackOverflow, where all user-provided content is currently licenced under CC licences.
CC licences can still be used for software documentation, and any artistic content (writing, music, images) contained in the product that the software is a part of.
This guidance relates to whether you can legally reuse code without infringing the rights of its owners. Even when you can, remember that:
Please note: this information should be regarded as guidance; not legal advice, which only a legal professional can give.