Do you write your code differently when you need to hand it over to a customer?
How does one balance the delivery of good code while at the same time not handing over too much "intellectual property"?

  • 2
    When someone pays you to write code, the intellectual property you don't hand over, would be considered stolen or at least unprofessional/unethical.
    – JeffO
    Jan 13, 2011 at 20:27
  • @Jeff O: I don't think @egil means to leave out portions of the code that are required to make it function (though I could be wrong). I think what's meant is, "How do I not give away everything I know so that they never need to consult with me again?" I don't see anything unethical about providing the customer everything they need but also allowing for at least the possibility of doing future business with them. Jan 13, 2011 at 20:59
  • @Jeff O: The contract should say who gets what, and it may not require handing over the code. The customer may not want the source code, or at least may be interested in not paying extra for it. The contractor may use proprietary code that he or she intends to reuse on other projects, and the customer may then get a discount or faster service or another benefit. There are several situations on which withholding source code would be legitimate. Jan 13, 2011 at 21:16
  • In addition to handing over the source code, you should also document the build process, what toolchain you used, any third-party libraries used (and where to get them) so your client can generate an executable that matches what you delivered.
    – tcrosley
    Jan 13, 2011 at 21:44

3 Answers 3


I'm not sure what your concern is here. If source code is a deliverable and you're paid for it, you're effectively selling your "intellectual property".

Code quality doesn't really enter into this decision. You should deliver code that works and is of some sufficient level of quality. I'd never consider writing worse code just because I have to release the source to another company and I'm afraid they'd use it. I mean, that's what it's there for, isn't it? To be used? If you don't want them to use your source, why are you selling it as part of the contract?

  • Thanks for the answer! Is it normal to hand over source code and how does this affect the price?
    – egil
    Jan 13, 2011 at 21:01
  • 2
    @egil I would say its almost required, no company in their right mind is going to trust your binaries that cannot be easily modified.
    – Woot4Moo
    Jan 13, 2011 at 21:09
  • Some people might feel compelled to write better source code if somebody else is going to see it. Jan 13, 2011 at 21:17
  • @David Thornley: Agreed.
    – Adam Lear
    Jan 13, 2011 at 21:35

If you have personally developed libraries that you leverage while programming for the customer, provide those only in binary form.

  • 1
    Unless this was stipulated up front, I would be extremely unhappy about this arrangement if I was the customer. Use of 3rd party software (and 'personally developed libraries' only available in binary form is effectively 3rd party software) needs to be laid out at the outset or avoided entirely.
    – Kris
    Jan 13, 2011 at 21:34
  • 1
    Those concerns can be addressed, and is no different than reliance on third party libraries (something that is practically unavoidable today). Definitely make sure that it is agreed upon up front. Some customers require the code for the libraries be placed in escrow (in the event of your company closing). Others are willing to pay extra for the rights to the code. It's up to you to decide what you're comfortable with (up to and including walking away if you can't come to agreeable terms). Jan 13, 2011 at 23:36

Typically when you are hired by a customer there are several lines that explicitly state everything you do is owned by the company. So you won't be handing over an intellectual property, the exception to this is if you declare any algorithms that you have developed yourself. In that case the company could be sued for utilizing your algorithms without permissions and/or compensation.

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