I have only recently started to market myself as a 'programmer' rather than an analyst or something else entirely. In a recent search of freelance/part-time/contract work, I came across an ad for a contract "R Programmer". I was well qualified for the position and submitted my technical resume. I had an interview and was asked to submit a proposal for some contract work for the company, a well-funded start up that has an interesting--and useful--product.

As part of the proposal, they would like, among other things, an R package that gives them the means to analyze their customer's data along with a write up of what the output(s) of my package means and how it would help their customers. The company also provided five samples of their client's data (along with an NDA that I was required to sign) so I could write and test out my code.

I'm curious as to how I protect myself and the code/R package I've written from being used commercially? In other words, I'll be providing this R package as part of a proposal; in other parts of my business, a technical proposal doesn't contain any sort of tool that could be used immediately as part of a commercial business. Is there some sort of copyright I could attach to the package or proposal documentation, similar to their NDA I was required to sign, that could afford me some sort of protection should they decide to use my R package without payment?

What is there that prevents a company from using a code sample commercially without paying the author?

  • Further research on this site has taken me to the Creative Commons License Builder which may provide some information. I discovered this link in the comments to a potentially related question: Protect Freelance Work
    – Steven
    Commented Dec 30, 2014 at 2:04
  • 6
    This question appears to be off-topic because it is about legal assistance and / or requires knowledge of software licensing beyond what can be reasonably expected from the community. Additionally, answers may vary based upon jurisdiction which pushes this question further out of scope for the site.
    – user53019
    Commented Dec 30, 2014 at 14:26
  • 2
    At least in the U.S. you automatically have copyright of anything you create even if you do not file the official paperwork, unless you assign copyright to another entity e.g. through an employment contract or work-for-hire. In this case you need to retain a lawyer who specializes in IP law in your jurisdiction for accurate advice. There could be any number of legal clauses included in the proposal paperwork of which a bunch of strangers on the internet (i.e. us) are not aware and are unqualified to give advice on.
    – user22815
    Commented Dec 30, 2014 at 15:53
  • 2
    Perhaps a better question would have been "what have other freelance programmers done to protect sample code provided for evaluation purposes from being used commercially?" As it is, given the 'off-topic' nature of the question (and the downvotes!), perhaps this should be deleted.
    – Steven
    Commented Dec 30, 2014 at 17:06
  • Perhaps the question should be, "Why do customers demand free work, should programmers just refuse?" Commented Dec 30, 2014 at 18:19

1 Answer 1


Your best bet is probably to write a clear statement in everyday language that the code is your copyright; is provided for information only without warranty to be read not used; and you forbid it to be used or disseminated without your express permission. You could say you would transfer the copyright to the client for some modest fee or if they engage you for a contract. There - perhaps I've done it for you :)

If you want to spend money, and probably some extra time, find a software lawyer, explain what you want, and pay them to write you a license agreement. Personally I'd suggest it's probably not worth it. Realistically, are you actually going to sue them if they use your code? If not, perhaps the best thing is if the intention of your copyright statement is clear, and not so much whether it would actually stand up in court (whether it has the correct legal phrasing).

What prevents a company from using a code sample commercially without paying the author? You probably have no way of telling whether they used your code internally. So, mostly, honesty. If they are organised (e.g. large, profitable, and have been in existence for a long time) they may have internal procedures/auditing that will prevent them using code illegally.

Not the answer you're looking for? Browse other questions tagged or ask your own question.