I work full-time for Company X and am approached by Company Y to provide consulting services to write Embedded C for them. While I know the basics of conflicts of interest, I know how important it is to share proprietary information, corporate knowledge, and proprietary algorithms. However, I have some questions about basic generic elements that I need to reuse:
Software architecture: I have a personal preference for layering application, abstraction layer and hardware driver. I do not want to do anything else and I am not the owner of the company. Would this be a problem if shared?
Generic functions: table lookups, sine / cosine functions, parsers, etc. I've written all the code myself. Can I copy this or do I have to rewrite, insert random spaces, change indentation, variable names, table sizes, etc.?
Function naming: I use a specific naming convention, eg. MATH_Sin (). However, compiled in a DLL, Company X can find a MATH_Sin () function in the Y company DLL and assume that I have copied its code. Do I have to rename all functions to hide similarities?
Public knowledge has been converted to source code: Let's say you find an algorithm on a paper that describes how to search for a pattern in a string, and you've converted the paper content into source code. Would copying and pasting be a no here? To rewrite or completely reject some things and find another way to do it? In the end, it's an implementation of public knowledge.
I asked about my colleagues, and I can not give a clear answer to what I should do. Software is digital and very traceable and can always be traced back to the developer.
To update: I contacted my supervisor and Human Resources, and they urged me to do so. They claimed that by using the same skills (embedded programming or programming in general) for another company, there is always the possibility that company X might challenge me or company Y. They responded "You could invest in a restaurant …". Serious?
Company X is a very big company. There is no negotiation between employer and company, there is no acceptance for open source / licensed code, and it seems they believe they have me and my abilities. Although I agree with some of their arguments, I do not agree that they have my education, and although I am committed to them, I can not use my basic skills for other purposes. Therefore, I have decided to follow the advice below and open my personal codes that are neither owned by the company nor written using company equipment or company time. I will not make any money or sign contracts, but at least I can keep my personal code and develop my career outside of this restrictive environment.
Thanks for all the answers. I hope this serves as a reference for others who are pursuing the same goal.