In the US, under what circumstances can I re-write code I previously wrote but do not own? I write code for company X in the USA using popular technology Y. In the course of my job I end up developing a number of useful libraries/widgets/utilities for use within the Y ecosystem that have nothing to do with X's business product per se: they are broadly useful across many applications. Some of these libraries/widgets/utilities are trivial to write, while others are elaborate and have taken months of work. The commonality is that none of them require any proprietary technology or information to function or to develop: any of them could be written by any Y developer sufficiently skilled and motivated. The code I wrote is work made-for-hire and belongs to company X; let's take it as a given that I can't use or publish this specific source code outside the company. (Let's further assume that none of the code is patented.) Who owns the ideas, the knowledge of how these libraries work? If I need to solve the same problem again (or if I just want to publish open-source code), how close can my solution come to the original? There are a number of related questions out there on Stack Exchange and elsewhere: How can I reuse generic code for consulting between companies? Can I rewrite code I wrote for a company from scratch? Can I adapt code I wrote for work and release it as open source? Does a company have IP rights to the stuff I do in my spare time? There are some very helpful answers in all those threads, but none of them really cover all the bases. I'm hoping this answer can be definitive by considering all the dimensions: Similarity to original What if the new code (presumably, in the case of something simple) comes out exactly the same (even if I rewrite it without looking)? What if the new code comes out almost exactly the same? What if the code achieves precisely the same function -- i.e., produces exactly the same outputs for the same inputs -- but works substantially differently? What if I change variable names or otherwise obfuscate the code purely to avoid copyright infringement, without changing the functionality? Circumstances under which the new code is derived What if I copy-and-paste from the original, but update a bunch of stuff so that the algorithm / architecture / etc. is substantially different? What if I look at the original code in one window while I re-type it verbatim in another? What if I look at the original code as a reference but substantially change things as I re-write? What if I don't look at the original at all, but it still comes out extremely close to the original? What if I have a photographic memory and reproduce the entire code verbatim without looking? Complexity What if the code is very complex and requires considerable engineering effort? What if the code is simple and requires little time to reproduce once you know how it works? Timing What if I rewrite the code immediately after leaving company X? What if I rewrite the code on nights and weekends while I'm still employed by company X? What if I rewrite it N years later? There may well be other dimensions I'm forgetting -- feel free to suggest them! My question is specifically about U.S. law, but illustrative points from other countries are welcome. I don't want to narrow the scope of the question to a single state within the US, so pointing out what is universal and what might differ between states would be very helpful.
Assumptions Let us assume that the code involved was created during the period of employment, was within the scope of that employment, and was validly work-made-for-hire (WFH). In that case, the code copyright is owned by the former employer.dn the person who wrote it has no more rights than a random stranger would. I am also going to assume US law. Ownership of Ideas Who owns the ideas, the knowledge of how these libraries work? No one does. In the absence of a patent, no one ever &quot;owns&quot; an idea. ]17 USC 102(b)](https://copyright.gov/title17/92chap1.html#102) provides: (b) In no case does copyright protection for an original work of authorship extend to any idea, procedure, process, system, method of operation, concept, principle, or discovery, regardless of the form in which it is described, explained, illustrated, or embodied in such work. Derivative Works Copyright law does prohibit anyone making a derivative work from a work protected by copyright without the permission of the owner. A derivative work is one &quot;based on&quot; the source work. The classic case is a translation. Exactly when a piece of software is a derivative work of another is fact-dependent. Bu several things are clear. If the source work is trivial and obvious, ther may not be sufficient &quot;originality&quot; for the source work to be protected by copyright at all. If the source work is not protected by a valid copyright, nothing is a derivative work of it. A &quot;hello world&quot; program, for example, is probably not original enough for any copyright. A straight-forward implementation of a basic algorithm like quicksort is probably not original enough, either. If there is only one way, or only a small number of ways, to express the ideas of the source work, the merger doctrine applies. This means that the expression of the work is merged into the idea, leaving the expression unprotected. When the merger doctrine applies, there is, in effect, no copyright. If a work copies ideas from a source, but none of its particular expression of those ideas, the result is not a derivative work, and is not an infringement of copyright. If a work is definitive, but is also a fair use of the source work, it is not an infringement. The usual four-factor fir use analysis must be made to determine this. In particular, if a work is highly transformative, it is likey to be found to be a fair use. Issues from the Question What if the new code (presumably, in the case of something simple) comes out exactly the same (even if I rewrite it without looking)? That Rather suggests that the work was too trivial to be original enough to have copyright protection at all, or else that there are only a few ways to express the idea, and the merger doctrine applies. But if neither o those were true, this might be an infringement. [* To be coninued*]
Yes. The copyright owner of a work has the exclusive right to "reproduce the copyrighted work" or to make "derivative works" of it. 17 USC 106. Copyright law is older than the photocopier, and it applies to copies made by means of any technology. If your intent is to duplicate the protected work, whether you do it by tracing, photocopying, or even freehand, you are infringing that right. It is possible that you could squeeze into one of the copyright exceptions, such as fair use, but these are much narrower than people tend to assume they are (especially outside of the U.S.), and they boil down to: "Well, yes, I copied your copyrighted work, but..." The bottom line is: is it copyrighted? Did you copy it, in whole or in part? Then, unless you have a very good reason, you've infringed the copyright. Whether you do it by means of tracing paper, jellygraph, or iPhone doesn't matter.
It depends on what you are selling to the enterprises. You could be selling just a licence to use the program, and retain all the rights on the source code. You could be selling the rights to the source code. For #1, the source code is yours and you can do what it pleases with it1. In fact many programs offer both an open-source licence (which usually forces the user to make its changes to the code publicly available) and a commercial one (which allows the user to keep the modifications of the source code for themselves). For #2, the source code is no longer yours so it is not up to you to decide what to do with it. 1I am assuming no other agreements imposing limits on those; for example that none of your contracts to your customers have a clause forbidding you from making the code available to the public.
Ideas aren't property Your employer does not own your ideas. However, neither do you. Ideas are not something that is protected by intellectual property law. To be IP, you need more than an idea. What is IP? The most common types are: Patents - protect inventions and new processes Trade marks - protect logos, words and other branding Copyright - protects art, writing, music, film, and computer programs Registered designs - protects the visual design of a product Circuit layout rights - protect layout designs or plans of integrated circuits used in computer-generated designs Plant breeders rights - protect the commercial rights of new plant varieties. The normal operation of IP law is that if a person is engaged under a contract of service (e.g. an employment contract) then their employer owns all the IP they make which includes progress towards something that might be IP (e.g. all the work that leads up to a patentable invention). However, if they are engaged under a contract for service (e.g. an independent contractor), then the worker owns the IP. The work the employer owns is generally limited to work in the course of the employment. So if you are a software developer they will generally own all code you write that is useful for their business but won't own the romantic novel you write in your spare time. In either case, the specific contract can override the default assumption. What can you do? You can certainly use the idea for the app but you can't use anything that is subject to your employer's IP. That means you can't use any code or copy the user interface - it all has to be redeveloped from scratch. You also can’t develop something that would be of use to their business while you are still an employee.
All your work is yours. They've made it very clear it wasn't a work for hire, so it's yours. They can't copyright any of their ideas. You can't copyright an idea. Only specific creative elements authored by them and present in your work could be covered by copyright. You didn't use their block diagrams. I don't see how references to other sites to look at would constitute a creative element they authored. That said, you probably want to talk to a lawyer and get a written legal opinion that you can rely on.
No, it means you can't copy it. By default, the copyright to a work is owned by its creator, and nobody else is allowed to copy it, or create derived works, without their permission. That permission can be granted by a license. "License unknown" doesn't really tell us anything, but it certainly isn't clearly granting you permission. So you don't have permission to copy, and thus you cannot. You would have to seek permission from the copyright holder. See also If no licence is distributed with an application/source code, what license applies by default if any? (Some jurisdictions do allow for "fair use" exceptions, which allow you to copy a work without permission. You haven't said what jurisdiction you are in.)
There is no IP in ideas Any code would by subject to copyright (who owns that copyright is itself a convoluted and separate question), however, if the 4 of you abandoned any existing code, notes and images and start over you would have no legal impediment.
Company B has created a derived work from company A's copyright-protected work, so yes, B has infringed on A's copyright. It might be difficult for A to prove it, however, so B might get away with it, but it's still infringement. On the other hand, if B creates software that behaves like A's through reverse engineering, that is, by examining the program's function without examining its code, then they will not have infringed the copyright in the code.