Get more things likethis right into your inbox.

How to correctly use code you didn’t write

Why should anyone write about that?

I’m writing about this topic because I recently saw some guys using my code in their projects without keeping the copyright notice (I really don’t want to blame anybody in this article). The fact that they used my code was not really the problem, I love inspiring other people to do awesome stuff based on some of my concepts and thoughts and I’m happy when I could help you with my code. So everybody is free to use my code, but now the important part, under the given license terms. You could also say “credit where credits needed”. Open source in the context of software does not mean you can copy the nice stuff and paste it into your project and tell everybody you did a nice job. That’s not the way it works, because the original author will get pissed and when the author got pissed it’s very likely that he won’t release great open source software anymore, or at least he won’t publish it. Think about it in that way: I’ve used great code from another developer, this developer has put lots of time in it in order to write this piece of great code, at least I could give credits to the coder in order to show my appreciation for it. I’m also writing about it because I’ve seen it ways too often, that no one cares about licenses.
This article should be a short summary about what exactly is to do when software is licensed and you’d like to use it. I picked out the most common OS (open source) licenses, because there are lots of it out there, feel free to look at all of them. You may use this article as a guide for the next time ;-) I’m not liable for completeness, if you think I forgot something, please let me know! If you like the article :)

GPL License

Keep the licensing header

Your software release has to be GPL licensed too

The original author has the right to license under different or multiple licenses, but you don’t

If anyone requests it, you have to make the sources available

MIT License

Keep the copyright notice in all copies

You are free to modify, redistribute and even sublicense the code under another license

The original author isn’t liable for any damage resulting from his code

BSD License

You are free to use, redistribute and license the code under another license

As long as you keep the copyright notice

You don’t have to publish the new code

LGPL License

You are free to use and modify LGPL published software

As long as you keep the copyright notice

You don’t have to license under the LGPL when you’re using the LGPL licensed software only as an external library otherwise you have to

You have to ship the sources of the LGPL licensed software with your software release

Apache 2.0 License

Keep the copyright notice

Your software has to contain a copy of the Apache 2 license

You are free to use, modify, distribute and redistribute the software

If you modify code you have to mention your modifications particularly

If there is a text file called NOTICE: Read it! It contains further information about specific parts of the license and the software’s purpose

The NOTICE file has to be included in your software release too

Essence

So you may have noticed that the licenses share at least one point, and that is “Keep the copyright notice“. If you’re an amateur software developer and just don’t give a crap about licensing, that’s the least thing you can do. All in all the message of this article was:Do not steal great code. Play by the rules. “Code creators” will appreciate that.
I probably will add some more open source software licenses to the list in order to make it more complete, if you’d like to contribute please leave a comment or message me!