9

I've been programming for a few years and now I realized something important when using GitHub. I use GitHub to download and see how other people create apps and learn from their tutorials and examples. There are times when I copy and paste small sections of code to see how they work and if they are useful to any of my apps.

But until now I realized that on GitHub each repository has a SOURCE CODE LICENSE AGREEMENT.

I'm trying to learn how to create a WhatsApp-style app and I found it on GitHub " stream-chat-swift", from what I'm seeing, analyzing, and learning from the repository code. But until now I saw that in its license it says that what I'm doing is illegal!

https://github.com/GetStream/stream-chat-swift/blob/develop/LICENSE

What does that mean?

I want to make it clear that the app that is in the repository has never been completely copied and made an app for me, I only downloaded it to see its architecture and if I'm honest, I have copied small sections of code that I think can help me, But nothing more. It is illegal?

It's important to note that I only use the project on my desktop, I do not share it in the cloud or upload it to GitHub.

5
  • 6
    Welcome to the real world. You have just discovered, that not everything on GitHub is free and open source. You are fine as long as you only use this code on your own desktop machine. If you plan to publish something based on this source available licensed code you might want to consult your legal counsel. Commented Feb 3, 2023 at 7:26
  • 2
    Note that this is clearly not an Open Source license, because it restricts who may use the software. It says that you must agree that "(B) CUSTOMER IS NOT A COMPETITOR OF STREAM.IO". That contradicts Rule 5 of the OSD, which says "No Discrimination Against Persons or Groups". The LICENSE also breaks other rules of the OSD, but the fact that only certain people are allowed to use the software is a big problem. Not even Microsoft's proprietary licenses say something like that (imagine if Apple employees were barred from using Windows, for example).
    – Brandin
    Commented Feb 3, 2023 at 7:34
  • @Martin_in_AUT Thanks, but one question... If I analyze the code and rewrite what I've learned in my app and publish it, is it illegal?
    – San Pad
    Commented Feb 3, 2023 at 13:13
  • 2
    @SanPad That's where things get complicated and you may ask another question or look for existing questions here. There is such a thing like "clean room reverse engineering" where two people work together to transfer knowledge from existing code, but in general you risk legal problems if you read the code and the rewrite it.
    – allo
    Commented Feb 3, 2023 at 15:35
  • 1
    You asked the same add-on question below and @MadHatter answered. I will not analyze this license agreement in detail and provide you with an assessment, where the grey zone gets too dark. If you plan to publish a similar software you should consider talking to your legal counsel for his/her opinion. Commented Feb 3, 2023 at 16:37

1 Answer 1

11

When you copy someone else code into your own work, you make your work a derivative of theirs, in copyright terms (with certain exceptions, which I don't propose to get into here). The right to create derivative works is one of the rights that copyright law allows the rightsholder to control. The licence you quote is clear that, for the code it covers, this right is restricted to certain purposes: you may

create derivative works [...] to build unique scalable newsfeeds, activity streams, and in-app messaging via Stream’s application program interface (“API”)

which you aren't doing. So yes, right now you're likely infringing someone's copyright. However, you're not distributing copies of the resulting code, so it's not likely this will be discovered, and if by some mischance it were, you're doing very little harm.

Nevertheless, you have discovered that putting code on GitHub isn't the same as giving it to the world, for which I applaud you (we cover it in more detail here ). If you want to be able to freely reuse other people's code, stick to code under permissively-free licences (eg MIT, BSD), which place very light (but non-zero) obligations on you if you create derivatives. The obligations on reusing Apache-licensed code are also light, but somewhat more onerous. The copyleft licences (GPL, MPL, etc.) are more complex to work with, but still permit the creation of derivatives.

Equally important is that all these licences permit the redistribution of derivative works. Sooner or later you're likely to want to share what you're doing with others, so being clear about what your obligations are should you do so is very important.

Good luck!

8
  • 2
    "Right now you're infringing someone's copyright" - OP is violating that license agreement, but violating a license doesn't automatically mean that you're infringing copyright. Besides, the owner of the code apparently decided to post it publicly on GitHub, which automatically grants certain rights to everyone. docs.github.com/en/site-policy/github-terms/…. A LICENSE notice in a project can optionally give more rights, but in principle it can't take away rights that you've already got.
    – Brandin
    Commented Feb 3, 2023 at 7:31
  • 3
    @Brandin I added a pointer to our discussion about the default terms github allows, and it's fairly clear those don't include a right to create arbitrary derivatives stored offsite. As I try to spell out quite carefully, doing something which is controlled by copyright law, without a licence to do so from the rightsholder, is copyright violation. Doing something which isn't controlled by copyright law doesn't require a copyright licence anyway, so I'm not sure I can make much sense of "violating a license doesn't automatically mean that you're infringing copyright".
    – MadHatter
    Commented Feb 3, 2023 at 7:43
  • 1
    @MadHatter Thanks, but one question... If I analyze the code and rewrite what I've learned in my app and publish it, is it illegal?
    – San Pad
    Commented Feb 3, 2023 at 13:11
  • 4
    You spotted that I didn't address that, because it's a really tricky area. Simply studying and learning doesn't violate copyright, but if you later have to write a similar sort of thing and accidentally or otherwise approach too closely the model you learned from, questions of infringement may arise, and proving a negative is difficult. I think it's safest to stay away from proprietary code, if you can, both for reusable examples and general learning.
    – MadHatter
    Commented Feb 3, 2023 at 14:19
  • 5
    Something that might be worth mentioning, because it's surprisingly common to misunderstand, is that similar considerations apply to everything on the internet. If you read someone's blog, they likely own the copyright to that text; if you find an image on Google Image Search, someone owns the copyright to that image. In every case, usage agreements and licenses are granting you limited permissions, not taking away any implied rights. Open Source software is not actually a special case in this sense.
    – IMSoP
    Commented Feb 3, 2023 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.