1

Suppose I refactor my program based on its reviews on codereview.SE. (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.

But what about the following cases:

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

(I'm based in the UK, if this matters.)

Note: A good concrete example is the following question (which I'm not involved in): validating-credit-card-numbers.

3 Answers 3

3

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.

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.

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 database of phone numbers: 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.

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.

2

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.

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.

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.

1

Paul Johnson and David Siegel are both correct.

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

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

"Take that finger out of your ear, you don't know where that finger's been." - Rex Striker

Beware of random code from unknown places.

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .