Hi people. I want to ask you what you think about using code from other people. I’m pretty new in LUA, and most of the time I learn by checking other addons. The only two addons I published on the workshop were based on another one. I obviously asked for permission to their respective owners before publishing it, I try to be as respectful as possible with other people’s work. However, sometimes I’m stuck with something I don’t know, and I find the solution in a piece of code from someone else, and it really feels like I can’t ask permission to every user in the workshop for every snippet I use. Perhaps it’s just a math formula or a function which does exactly what I need, and I need to use it exactly like it is. That’s when the line between stealing something and learning from it becomes blurred. What do you think?
nobody cares as long as you give credit and dont say its yours
No, you always ask unless it has a license allowing you to.
I have no idea why you’d think it’s a good idea to just take someone’s work and send it out without asking the person who made it if it was okay.
That’s just a rule of life in general, not just coding.
Yes, I know that. I’m talking about using small pieces of code, not copying an addon and modifying it… Things that, if I had to do them by myself, I would do them almost identical because I learnt how to do it by looking at someone else’s code.
You know people do that with music right?
Its literally everywhere
So no, its not a rule of “life”
The best you can do is rewrite the code anyway, after thoroughly understanding how it works. Rewrite it to your specific application, and cite where you figured it out from in a comment. When you release, write that you figured out X by looking at Y.
That way you’re giving inspirational credit where due. There isn’t anything you can really do about a short math calculation that makes you go ‘oh that makes sense now’.
Basically: could someone fairly patent a piece of code so that nobody else is allowed to use it? if not, because the code is simply too generic and uncomplicated, take the code and just mention in a credit your thanks to where you learned the concept from.
If someone could reasonably patent a certain concept, and thusly ‘own’ it, it isn’t for garrysmod anyway.
**TLDR: **It’s not like you’re lifting whole 100 line blocks of code into your own project, so don’t worry about it. There isn’t much you can do for just-so-happening to learn a common programming concept via seeing someone else’s code. Someone else doing something easy first doesn’t mean they own the entire idea.