If I read through the source code of programs in the similar field of application like the one I am working on (e.g.: 3D car racing simulation), and find some techniques or patterns they use better than the ones I am using, and use those in my project - is it theft?

(No source code would be directly copied in any way.)

  • 1
    What licenses are the bits of OSS released under?
    – nmichaels
    Mar 17, 2011 at 17:45
  • If it's MIT you need to give the author's works attribution. If it's GPL, your project also needs to be licensed as GPL. If it's a library and LGPL, you can use it as-is as a library as long as you don't change the library or derive anything from it and include the license file with it if you distribute the code. Other copyleft licences fall somewhere between these two. opensource.org/licenses is where you get the nitty gritty details on all Open Source licenses. Mar 18, 2011 at 12:19
  • 1
    @Evan Plaice: That's true if there is anything requiring copyright. If the OP takes significant source code from those projects, what you say is true. The question is whether the license applies; that is to say, whether what the OP is doing would violate copyright without a license. Mar 18, 2011 at 13:52
  • @David the copyright is just a stamp of ownership. That's what attaches the developers name to the work. The license are the usage rules of that particular section of code. So, MIT license allows the work to be derived and used in any way you want as long as you maintain attribution. Ie, you can copy it, derive from it, sell it, distribute it, re-license it, whatever you want as long as you don't remove the copyright with the original author's name from the top of the source file. MIT is a very liberal license whereas GPL is pretty strict about how it's used. Mar 18, 2011 at 15:12
  • @David as far as what the op is proposing, as long as it isn't copied verbatim. Techniques and patterns can't be copywritten/patented in our crazy legal system yet (or else you'd have to pay licenses to use data structures like a linked list or technique like binary search). You are free to cherry-pick useful concepts as long as it isn't a wholesale copy. If in doubt, just ask the devs. They probably won't mind. Most open source licenses exist to ensure that work is either freely available, or free from being copied wholesale and put under a restrictive license by someone else. Mar 18, 2011 at 15:20

4 Answers 4


It depends.

Generally, any author of a creative work (book, painting, computer program or whatever) is granted certain monopoly rights on the production and use of that work. The specific rights, and the length of time those rights apply, are encoded into national laws.

As a general rule, you cannot make a copy of that specific work. There are, however, many exceptions.

1) You may copy ideas, patterns, and designs. You may not copy specific expressions of those ideas. So, you could write a song about what a great state Oklahoma is, even if you are inspired by Rogers and Hammerstein's "Oklahoma!", but you couldn't include lines like "There's a bright golden haze on the meadow", since Rogers and Hammerstein wrote that specific expression.

2) You may copy expressions, if you have permission. There are a million ways to get permission to do that, many involving exchange of funds. The general rule is: if you have permission from the copyright holder, you may do what he permits.

3) You may perform acts that would otherwise violate copyright for certain "fair uses." What constitutes fair use is a very complex subject. Your use probably isn't fair use.

4) Any work created by a US Govt employee as part of his job description is not subject to copyright. Works created by US Govt contractors are.

5) Any work sufficiently old (for a very complex function of old()) is not subject to copyright. You may write "Romeo and Juliet", but you probably ought not write "Lord of the Rings."

6) In some countries, any work for which the author has explicitly disclaimed copyright is not subject to copyright. This is sometimes done with a statement like "I hereby place this code in the public domain."

So, what does all of this have to do with your question? Simple:

1) The work that you looked at is subject to copyright. You may not, generally, make a copy of it.

2) The authors of the work have given you prior permission (subject to a certain contract) to use and copy the work in certain ways. That is the definition of "open source." To understand what permissions you have, you must look at the "copyright notice" or "license notice" near the top of the source-code file, or otherwise packaged in the source code.

3) If you didn't copy any of their code, then you don't need their permission. Copyright applies to specific expressions of ideas, not the ideas themselves. If I write an implementation of quicksort(), then my source code is subject to copyright, but the algorithm that I use is not.

I am not a lawyer. These are general statements, and may not specifically apply to your situation.

  • Although it wouldn't be copyright - you might infringe a patent by implementing the same idea yourself in your own words. Software patents are a lot more difficult than copyright Mar 18, 2011 at 6:35
  • @Martin Beckett: Yes, but F/OSS advocates tend to hate software patents, and as far as I know don't have them or enforce them. The main danger here is other people's patents, and where you get your code from is irrelevant for that (unless the F/OS license you use has terms about patents). Mar 18, 2011 at 13:55
  • @David - everybody hates software patents (except possibly Larry Ellison!) and a FOSS project is unlikely to enforce them. I was just making the point that copyright isn't the only trouble you can get into. Mar 18, 2011 at 15:17
  • @Martin: Patent trolls like software patents. You're right in that copyright isn't the only problem you can have, but it's much more complicated. If you copy code I have copyrighted, that's between you and me, and if you have a valid license from me you're OK as far as copyright law goes. You may be in patent trouble from anybody, and a license from me doesn't affect that. Mar 18, 2011 at 16:06

I'm not a lawyer, but you're pretty much fine. The highest standard for this kind of thing is called cleanroom coding, where you don't get to access the competitor's code, and that gives you pretty close to 100% protection from copyright claims if they are made against you.

That's probably completely unnecessary though, unless you're expecting an attack. If you look at another project's code, learn from it and then code your own project using ideas from the other one, you're definitely fine.

Part of the goal of FOSS is this kind of collaborative sharing. You might also find it useful to ask the owner of the other project and see if they mind you doing wholesale copy/paste. Odds are in your favor that they'll say yes for many projects.

Another question for you: What license are they using? Depending on the license wholesale copying may be permitted.


If you couldn't use algorithms because of copyright law, for example, no one could use software patterns, like singleton, visitor, composite and so on, because they would be copyrighted by the gang of four.


If both algorithms and the open-source code is not copyrighted, and most open-source stuff downloaded from open source sites are not, there will be no 'copyright infringement'.
However you need to read the code license to know for sure if you can take algorithms.

  • 4
    The open-source code is copyrighted. In most countries, including USA, every creative work is subject to copyright starting at the moment of creation. Look at any open-source software source code. The first line probably says "Copyright 2011 Rob Adams" or something similar. You need to read the code license to know for sure if you can take the code. Algorithms, however, are a different story. You can always take algorithms without concern for copyright infringement, they are not subject to copyright.
    – Rob Adams
    Mar 17, 2011 at 17:37
  • 1
    If some code isn't copyrighted, there's no need for a license. The GPL depends vitally on copyright for its effects, not to mention that its reason for existence is to subvert copyright. Mar 18, 2011 at 13:58
  • Hi @Hossein, I think potentially you may be mixing up copyright and licenses. Many open source projects are permissively licensed. To a rough approximation, copyright is about who owns the code, and licensing is about who the copyright holder allows to use the code. Mar 29, 2019 at 2:12

Your Answer

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