If someone reviews my software program, when do they share its copyright?
<p>Suppose I refactor my program based on its reviews on <a href="https://codereview.stackexchange.com">codereview.SE</a>. (Or someone reviews my pull request on GitHub.) Presumably, if I include the reviewer's code, they share copyright to my new program, unless their code is trivial.</p>

<p>But what about the following cases:</p>

<ol>
<li>I use the reviewer's code as a starting point and change it for my program. (I guess this depends on the  changes.)</li>
<li>The reviewer suggests detailed solutions in English, e.g., bug fixes or software designs. Then I translate these solutions into code. </li>
</ol>

<p>(I'm based in the UK, if this matters.)</p>

<p>Note: A good concrete example is the following question (which I'm not involved in): <a href="https://codereview.stackexchange.com/questions/169530/validating-credit-card-numbers">validating-credit-card-numbers</a>. </p>

<p>If you use the reviewer's code, or code derived from it (e.g. if you just changed a variable name) then they own the copyright on that part of the software.</p>

<p>If the reviewer describes a solution which you implement, or if you re-implement the code from scratch while taking ideas and methods from the reviewer's code, then you own the copyright on that code.</p>

<p>However if there are only a few ways to implement something in code then the code is not creative and hence cannot be copyrighted. For example the regular expression in the question you link to is (as far as I can tell) the only correct solution to the problem: any programmer addressing the problem will have come up with that RE. In this the position is akin to a <a href="https://www.pinsentmasons.com/out-law/guides/database-rights-the-basics" rel="nofollow noreferrer">database of phone numbers</a>: while the collection may be copyright (depending on whether selection or arrangement required creativity), the fact that Alice Jones has the number 012345 is not copyrightable, and neither is the alphabetical arrangement of names.</p>

<p>Where it gets messy is the boundary between the two. The requirement to detect 4 or more repeated digits in a credit card number could be implemented in a number of ways, but whether there are enough of these to qualify any particular solution as "creative" would be a matter of fact for a court to decide.</p>

<p>The answer by Paul Johnson is quite correct. A good practice would be to use the reviewer's description of the problem, and of the needed solution, but without referring to the reviewer's code example (or referring to it as little as possible), derive new code to solve the issue.</p>

<p>If the developer uses the reviewer's code in creating the solution, and ther is concern that the code may be creative enough to be separately protected by copyright, one solution is to ask the reviewer for written permission to include the code, or code derived from it. The reviewer might ask for some sort of credit or acknowledgement.  </p>

<p>If the reviewer asks for a fee, then it may well be worth the effort to re-do the solution in a way different enough that it is not derived from the reviewer's code. If that cannot be done, then there may well be only one way to solve the problem, and the code to solve it would not be original and distinct from the idea of the solution. Ideas as such are never protected by copyright.</p>

<p>Paul Johnson and David Siegel are both correct. </p>

<p>But to add, if the code the reviewer shows is just a <em>common method</em> — for instance, the reviewer is just reciting Quicksort — then the reviewer would have no expectation of a claim there.</p>

<p>But also be careful — a reviewer could use an example of code that is <em>elsewhere</em> protected, wherein the reviewer is using it for example via fair-use exemption, but the code snippet is <strong><em>otherwise protected by copyright or patent.</em></strong> The fact the reviewer is using it per <em>fair use</em>, does not extent that to <em>your</em> use, especially if your use is commercial.</p>

<blockquote>
  <p><em>"Take that finger out of your ear, you don't know where that finger's been." - Rex Striker</em> </p>
</blockquote>

<p>Beware of random code from unknown places.</p>

<p>Some code may be protected by copyright, some by patent. If you didn't write it yourself, then surely we don't know the history or what protections it might currently fall under. </p>

copyright intellectual-property software licensing