
Ask HN: How to avoid legal issues when writing company-owned generic code? - amorphid
I currently work in a cloud ops role at a large company, and some of the code I write is incredibly generic.  A specific example would be a wrapper script for system command.<p>Say I write a wrapper on company time for the `dd` *nix utility, and call it `MyCompany.BlockDecive.create`.  The company owns that code, and there&#x27;s no question about that.  But now that pattern is stuck in my head, and for a personal project I write `MyPersonal.BlockDecive.create`.  The `Xxx.BlockDecive.create` is so generic, and uses a convention I like, that I might end up recreating the something nearly identical.  I don&#x27;t wanna steal anything, and I don&#x27;t want to even appear like I&#x27;m trying to open source company IP without permission.<p>Obviously getting a company&#x27;s permission to open source something solves this problem, and I&#x27;m doing what I can to pursue that as an option.<p>Here&#x27;s a real world use case for where this might come up...  On Friday, I don&#x27;t know how to implement a technical solution at work.  Over the weekend, I figure it out, and post the code to GitHub in a sample app.  On Monday, I recreate the sample app in a company owned project.  Later on, someone discovers my sample app on GitHub, and now I&#x27;m being investigated for stealing company IP.<p>I&#x27;ve never gotten into trouble over this, and am not being investigated.  I&#x27;m just researching how to keep myself out of hot water, so that if anyone sees my coding style in two places, there&#x27;s no issue to be raised.  I want to be conservative and honor the spirit of my employement contract.<p>&quot;I am not a lawyer&quot; (IANAL) responses welcome.
======
informatimago
IANAL

\- First check your work contracts. US corporations often make you sign
abusive work contracts where they own anything you think or write even on your
own time. In that case I would advise you first to negociate a new contract.

\- One way to avoid mixing work with pleasure would be to use entirely
different programming languages and stacks. However, it's true that a program
can be considered derived work of another independently of the programming
language (in terms of copyright laws, translations are considered derived
works), and there are of course those silly software patents and IP.

\- Therefore: Just don't do it.

\- Or, if you really cannot help, once you've pushed to github your own code,
you could license it under GPL or BSD/MIT, and then at work ask for permission
to include this open source library. This will give you a couple of weeks or
months before the legal service answers by the negative, and then you will be
able to re-invent it in a different way, or to find an entirely different
solution.

------
Bino
IANAL but the first question, which country do you live in?

~~~
amorphid
I live and work in San Francisco, CA, USA.

~~~
sfrailsdev
I am not a lawyer. My understanding is that CA has different laws concerning
IP then most states, where is you don't use any company resources or write it
for the company, you effectively own the code. I tend to think you are
overthinking it... your generic wrapper scripts are likely not valuable enough
the company to care about, they probably aren't the secret sauce.

