copyright software
Can I use unsolicited code in my commercial project?
<p>I hope this is the right forum for my question. I am selling software which buyers get the full source code of. It is distributed through a 3rd party store system which does not let me know the actual identities of the customers.</p>

<p>The other day a customer out of the blue emailed me code which is very well usable in my software, it is not per se deal-breaking if it's not in there, but it's definitely also not something I would dismiss. You could argue it is very much increasing the worth of the product.</p>

<p>I have a question about the legality to use the code (about 2 hands full lines of code in a class of 300 lines already present in my software) I was sent by email without further comment about whether I am allowed to include it in the my software. He just said (paraphrased): "Any reason not to do it that way?" I did not ask for his code submission nor did I know the author before he emailed me.</p>

<p><strong><em>EDIT</strong>
Please excuse me. I had another look at the mail just now.
The subject of the mail is literally: 
"[Suggestion] Optimization of >pluginXYZ&lt;"
This is an aspect I forgot to mention in the original question, in fact I for some reason did not even notice it consciously, my bad.</em></p>

<p>I answered him to say that I like his code and would like to put his suggestions in the package (which then all existing customers receive as free update) but have not received an answer.</p>

<p>Does somebody know the standard rules in such a situation where nothing specific is/can be negotiated? Am I allowed to include it because he sent me plain code which is 1:1 "pluggable" in my commercial package? I would not mind to credit the author of the changes in the file also, of course. </p>

<p>The obvious answer could very well be "No, you are not allowed to just paste it in your commercial software without express consent". But if you think about it, if I were now to be motivated to include an algorithm for the solution he gave but wasn't supposed to include <em>his</em> solution because he never expressly consented to it, well I cannot "un-see" his solution. And as I now know the algorithm because he personally suggested it to me, should I just do as if I never saw the mail, and try to come up with an algorithm for what he suggested to me which is expressly different to the one he sent me, to avoid any suspicion? Sounds non-sensical to me, but I am not a lawyer.</p>

<p><strong><em>EDIT</strong>
I had another look at the mail just now.(see EDIT notice above)
I did try to contact him now for several more weeks and no success :(
What would you say, does the fact that he sent this mail with the subject starting with "[Suggestion]" change the matter legally? He seems to indicate that he is presenting this solution to me for usage, don't you think?</em></p>

<p>The basic principle about copyright protection is that the expression of an idea is protected, but the idea itself is not. So wholesale copying without permission is infringing. But the abstract algorithm is not protected by copyright (and let us assume that it also isn't patented). By way of analog, an insertion sort is a pretty easy concept to grasp, and once you understand it, you can re-create it, independent of how the original example (where from you learned about the sort) is expressed. So the question is whether it is necessary for you to copy that code (copyright protects against copying), or can you independently re-express the algorithmic idea (ideas are not protected)?</p>

<p>The code has the author's copyright.</p>

<p>You need to get him to either sign a statement putting the source code into the public domain, or you need him to assign the copyright to you.</p>

<p>To put it in the public domain, he needs to write "This code is free to use by anyone. Signed XYZ (the author)."</p>

<p>In all honesty, the chances of some random private individual trying to sue you over a code fragment like this is practically zero. It costs hundreds of dollars in court fees alone just to file a lawsuit. If you have any concerns, just run the code through an obfuscator. This will change the "form of expression" of the code. In copyright law, the violation must be a "copy" of the copyrighted work, meaning have the same form of expression. Once it is obfuscated, it will no longer have the same form of expression so it will be immune to copyright claims.</p>
