If you write code, you also reuse code, including code snippets, libraries, functions, frameworks, and entire applications. All software source comes with certain rights and obligations if you want to add it to your database. Free and Open Source Software (FOSS) is free, but you can't use it the way you want. Even unlicensed code snippets copied from Stack Overflow are required to be reused. But formally developed code usually comes with a specific software license. Specific software licenses require that you meet certain obligations if you want to reuse the code. Here are some common types of software licenses.

Why Software Licensing Must Consider The Needs Of The End User - eLearning  Industry

There are many different types of software licenses and the penalties for breach of the license can be severe. If you reuse a component without complying with your license obligations, the licensor could sue you and could be forced to publish their source code. To protect your code and your organization, you should understand these software licenses before using any code, including libraries and frameworks, that you have not written yourself. Check out our list of the top open-source licenses and their potential legal risks.

What are the different types of software licenses?

Here are five types of common software licensing models that you should know about. Four are examples of open source licenses (which allow you to reuse code to some extent), and one does not allow reuse at all.

Public domain: This is the most permissive type of software license. When software is in the public domain, anyone can modify and use it without restriction. But you should always make sure it is safe before adding it to your codebase. Warning: code that is not explicitly licensed is NOT automatically in the public domain. This includes code snippets that you find on the Internet.

Permissive: Permissive licenses are also known as "Apache-style" or "BSD style". They contain minimum requirements on how the software can be modified or redistributed. This type of software license is perhaps the most popular license used with free and open-source software. Aside from the Apache license and the Berkeley Software Distribution license, another common variant is the MIT license.

LGPL: The GNU Lesser General Public License allows you to link to open source libraries in your application software. If you simply compile or link an LGPL licensed library with your code, you can publish your application under any license you want, even a proprietary license. But if you modify the library or copy parts of it in your code, you will have to publish your application under similar terms as the LGPL.

Copyleft: Copyleft licenses are also known as reciprocal licenses or restrictive licenses. The best-known example of copyleft or reciprocal license is the GPL. These licenses allow you to modify the licensed code and distribute new works based on it, provided that you distribute any new work or adaptations under the same software license. For example, a component license might state that the work is free to use and distribute for personal use only.

Therefore, any derivatives you create will also be limited to personal use only. The problem here is that users of your software would also have the right to modify the code. Therefore, you will have to make your source code available. But of course, exposing your source code may not be the best thing for you.

Property: Of all the types of software licenses, this is the most restrictive. The idea behind this is that all rights are reserved. Typically used for proprietary software where work cannot be modified or redistributed.

How do I know which licenses apply to the code in my codebase?

Before you can determine which licenses govern any reused code in your codebase, you must create a software bill of materials or a list of all components of your code. And the fastest way to generate that list is with a software composition analysis tool. A good SCA tool will be able to find complete components, as well as code snippets, and tell you which licenses apply to which code snippet and if you might be using conflicting licenses.

Is it risky to use open source software?

Permissive open source licenses generally allow you to use an open-source component freely as long as you maintain the copyright notices. But if you use a component with a restrictive license in your proprietary software, you may be legally bound to release your software under the same license (that is, as royalty-free open-source software). As long as you manage your open source usage (that is, you know what's in your codebase and what kind of licenses are attached), you can manage your legal risk. But keep in mind that very few organizations track their open source usage well, if at all. The rest are exposing themselves to legal risks.

Author's Bio: 

Carlos is always writing something on a daily basis and sharing it with the people. This is her hobby to write on different topics, especially on Design and Technology. She enjoys reading and writing blogs, socializing, meeting people, and traveling.