So, i've started working as a freelancer and therefore find myself copy/pasting util methods from one class to another. Not good to say the least.

I do this on my mobile frontend dev and backend .net.

I'm thinking of creating a Utility library for each platform I develop on. Then, when I start a new project drop the library in and I have instant access to helpers for e.g. persisting kvp settings, Basic ORM, generating HMACs for API requests etc..

Obviously this is a good idea and i'm not asking should I do it, more about any tips people would have or the best way to integrate and maintain.

I'm basically putting this out there to here what others do so it might give me some ideas when I start.


marked as duplicate by whatsisname, Scott Whitlock, user22815, Bart van Ingen Schenau, M. Dudley Oct 27 '14 at 15:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 5
    This is not obviously a good idea, due to the legal implications of using this code for different clients if nothing else. – Telastyn Oct 27 '14 at 13:28
  • 1
    @Telastyn Yes, that is very true. I was about to ask that also but didn't want to ask too much. My opinion on that one is that I provide solutions for clients as a freelance developer. I may at my discretion provide them with code, but I will retain IP on the code unless specifically asked for, in which case I write all from scratch then charge pro-rata. – jim Oct 27 '14 at 13:46
  • Yeah the questions are very different, even if both are regarding utility libraries – Jon Story Oct 27 '14 at 13:49
  • It's a good question, but I prefer "How do you maintain or manage your own utility libraries". – umlcat Oct 27 '14 at 17:00

Yes, with the caveat that I explicitly state in any contract that:

  • any utility code remains my property, with a perpetual licence for the client to use that code within the confines of the project in which it was supplied
  • the client does not have an exclusive licence for use of that code, I reserve the right to re-use the utilities for other clients
  • the above does not affect any code written specifically for the client, for which they have an exclusive license (if applicable and paid for)

This neatly gets around any problems of exclusive licenses - the client exclusively gets any new code written for them, but not my utilities which I make clear are re-used, non project specific and keep the costs down for them as I don't have to re-write generic code.

The perpetual license for the life of their project avoids any "what if he withdraws permission" worries, and is harmless to me as they're just basic utilities with no real value.

I make it clear in the source and contract exactly which parts are my utility library and which are their code.

Note that if you only ever grant a licence to use your code or have a non exclusive agreement, the above is irrelevant :)

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