View Full Version : How much right to I have to copy?

03-31-2007, 03:10 PM
Let's say I need a algorithm in a particular language that needs to perform a particular task. I find such an algorithm on a university web site. As expected, it is about twenty lines of code. I take the algorithm, change one of two input variables, rename the all the internal variables, rearrange the steps, and modify the output. After all this, my algorithm still bears a similarity to the original. Usually there is more than one way to skin a cat, and I'm not sure weather or not this really counts as a second way. I also can't say for sure that there is a second, more distinctive, way. Is this modified code mine? What does one do when they've searched high and low for something more original, and can't find anything practical?

03-31-2007, 03:18 PM
It would probably be considered a "derived work", though I am not an expert on such matters. University licenses are usually not very strict. Read the license agreement to see the restrictions on derived works.

I can tell you in advance what it would mean for you if the license was one of three common licenses.

"In the public domain": you can do whatever you want, even take the original code and call it your own.
BSD-style license: same as in the public domain, except that you may be required to put the original developer in your credits. (You'd probably want to do that anyway. :) )
GNU GPL (General Public License): you can modify the code and are in fact encouraged to do so, but you must release the modified code under the GPL as well. Basically this means that you have to give the source code to whoever wants it. I put my programs under this license anyway (usually).

Post a link to the license agreement if you like.

If the license is too restrictive, find the same code somewhere else under a less restrictive license. :) And if you can't do that, contact the original author of the code. They may be willing to give you a break.

04-01-2007, 03:26 PM
I also put my code under the GPL, In the Public Domain someone can take your code not change one character and copyright it as their own, it's just not right :(.

04-02-2007, 09:50 AM
Copyright on a 20-line code snippet seems un-enforceable unless the code itself is somehow a distinct artistic creation (like, obfuscated code). I wouldn't worry about it.

Also, copyright doesn't cover the problem of "I do this in the same way as he does.", that's a patent issue. In general, it's safe to assume code you pull off of university websites is not patented.

04-02-2007, 09:57 AM
>After all this, my algorithm still bears a similarity to the original.

Your "algorithm" is the same as the original, textually changing a few things doesn't change the underlying algorithm.

>Is this modified code mine?

The short answer is, no. It's like taking someones novel and renaming all the characters, that doesn't make it your book.

04-02-2007, 10:14 AM
I think the safe way would be to quote the source. And then say you were inspired by it.

04-02-2007, 10:43 AM
If you understand the algorithm, just rewrite the whole thing from scratch without looking at the other code. If you cannot do that, then you don't understand the algorithm used and you are copying the code.