DEV Community

[Comment from a deleted post]
Collapse
 
recursivefaults profile image
Ryan Latta

Ooh, kudos to you for taking this seriously.

Yes, if you drop someone else's code into yours that had a copyright that is bad.

The likelihood that they'd ever find out or do something is almost zero.

But, for a moment I want you to think about this from another angle. When you read a book that has code examples in it, how would you make use of that? You'd fundamentally have to rewrite it and the authors intend for you to do that. Books of coding examples are very much under copyright so you can't just take the material without citing it, but you are supposed to re-use it.

So here're some ways you can maybe feel better about looking at examples:

  1. Cite your source in a code comment
  2. Rework the example so it isn't 100% a match
  3. Don't publish your practice where you make use of the examples.

The first one is exactly how open source works. We have to provide licenses and sources for what we use. Two is likely going to happen because you'll name things differently. Three is because sometimes we need to see it work as-is before we make some changes.

Hope this helps!