Using own code at work: should I keep the license of the original code?

As an owner of the code I think I can relicense it as I want, right?

Why do I even care? I just don’t want there to come a time where someone might claim that it was the reverse situation than it is, aka that I took the code and used it in my projects, that’s all.

Thoughts?

1 Like

Was it made at work?

When I was in college the games design course had a few if these cases where a project turned into an actual game and the ownership was always claimed by the college because it was started there. People ended up being very protective and careful to only work non their own ideas outside of the building.

So if it is yours protect it.

3 Likes

No, as I said it’s my own code. Own as in, made outside of work.

Check your employment contract (carefully).

You may actually have a contract that dictates that anything you write whilst under employment of your company is the company’s work, even if it is outside of business hours (even at home, on your own equipment).

So depending when it was written and what your contract says, it may even already be theirs.

If it’s still your code, you can grant them a specific license for it. I’d be discussing it with the company legal counsel before proceeding any further. And definitely raise the issue that you think it is your own, with details of when it was written, so that the company has no chance of instigating legal proceedings AGAINST YOU in the future (and then you need to prove your ownership at that point).

Last i checked, i am actually under this sort of contract, as I am on salary and considered to “put in the hours required”. Thus, whether i am on the clock or not, i am considered to be working for the company.

I could negotiate a particular piece of code and i’m fairly sure the company i work for would grant me the license if it is nothing to do with their business and i wrote it out of hours, but the default is that they own it.

6 Likes

This is one of those situations where asking here might not get the true answer…

My advice is check your employment contract (and employee handbook if there is such a thing) carefully, some companies stipulate that anything you create, even on your own time at home belongs to them. The legality of this, if it is there, largely depends on where you live and work as different states/countries have very different employment laws and employee rights.

EDIT. @thro beats me to the punch…

4 Likes

Hi highly advise you follow the advice of @thro and @BGL, I made this mistake when I was younger and ended up giving away a library of code to my employer that I had been working on to for years simply because I shared a small portion of it with the company. Legally there was nothing I could do about it.

5 Likes

I wrote that code before I was employed.

Also

that’s such bullshit

True, it is, but it happens. People need to be careful, I was warned once about some scripts I wrote and I’ve seen other told to take down useful powershell scripts they created from public facing repos.

2 Likes

Then you’re in the clear; however if you are in any way considering using it at work, i would run it by legal first, pointing this out and negotiating a specific, non-exlusive license for them.

I’d also hash the file(s) you shared and document/keep both the sha hash(es) of said files (and the exact copies of the code at that time), so you can be sure what was and was not shared.

Yes and no. I am expected to work after hours as required, and this means there is no ambiguity with regards to who owns what (am i on the clock when i wrote it or not? etc.). If i write code, unless i get it released by legal it isn’t mine.

Of course if i was to release to the public domain under a pseudonym from home it’s very unlikely anybody would ever know but that’s a whole other risk.

Now, like i said, the company i work for is reasonable and if it isn’t something that would grant a competitive advantage to the company i’m sure they would let me keep my code (e.g., if i wrote a driver or non-business package like a game or whatever). But it is up to me to follow it up and get it cleared.

Most people don’t write code for personal use so its a reasonable default position IMHO.

But yes, read your contract and follow this up sooner rather than later, definitely.

2 Likes

what if that code is currently under MIT?

Then you should be able to point out where it is available on the internet and/or the existing license from before you were employed.

Again, you really need to clear this with legal (so they know you already had it) and get a record of those dealings to cover your ass in future.

This doesn’t have to be a massively painful process, but you do want to make sure there is documented history of you doing this so that in 5 years or whatever you’re in the clear.

2 Likes

I still wouldn’t call it reasonable, I guess it is reasonable as in they’re covering their ass.

Depends on your point of view, but yes.

The company legal doesn’t know every single piece of code being written inside the business.

If you want something to not be their property it is up to you to get it cleared, etc.

Again though YMMV, depends on your contract. Just please make sure you don’t assume you own it unless its discussed with the lawyer first - especially if you’re going to add it to a company project which could result in the history being a little muddied in the future.

You want evidence of the legal discussion to be able to refer to in the future in case anything happens.

edit:
additionally - if you were to go adding code to the company project that is not their exclusive property then any copyright THEY put on the project as whole needs to specifically exclude it.

so yes, covering their ass, but not just because they’re being unreasonable… because unless there’s documentation supporting where the code came from (if not written in-house) they may be in violation of all sorts of licenses (e.g., i release my code under the buy me a beer license, and contribute to the project and the end users don’t buy me a beer…).

1 Like

Thanks for all the info guys, this is great, I’ll talk to PM (we’re startup, idk if we even have a legal dep) and go from there.

It’s not much code I wanna add, just some utils, but it’s from my side project that I value.

3 Likes

I’m sure it won’t be a problem so long as they know about it. :slight_smile:

I’m sure that they’ll also appreciate you bringing it up now rather than after it’s already there.

But do make sure you keep your own records/notes of the proceedings (e.g., in your diary “met with X to discuss granting license of my project files, outcome was Y”) and keep the shared files/etc. in a safe place for future reference.

Like i said above, i’d pop the functions you intend to share into a file, hash the file, and record both the filename and hash in the legal document. The company/you can then insert the code fragments wherever into the main project, but you have records indicating exactly what fragments were shared (and they can presumably be located in the code via grep, etc. in the future if required).

e.g., in 5 year’s time the contract has the file hashes listed in it, you can then produce the files containing what you shared that match said hash…

Or include the entire files in the contract in printed form, but that might be over the top etc. Maybe as an appendix.

2 Likes

You should never write free code unless you are willing to have it stolen or give it away. Never grant license unless it is something worthwhile. Be sure to charge stupid maintenance fees. Otherwise take it with you and let them crash. You owe them nothing.

Always seek legal advice :slight_smile: Always protect your ip ruthlessly.

1 Like

I just want to add few thoughts on my own. Please add “IMHO” to every statement and remember that I’m just a developer - that just happen to reads contracts carefully.

In general I think you made a big mistake, by doing something first without verifying the facts (thus my elaborate).

The specifics of your case depend on the contract and state you are employed in.

Contract - copyright ownership

In my opinion, a good generic employment/B2B contract, regardless of territory/country, should contain statements similar to:

  1. commercial copyrights to the code solely remains on the company side.
  2. the developer gives all commercial exclusive rights to the created code to the company
  3. the developer makes sure that the code used or made for the company is free from any copyright claims

There is also a thing that there might be some implied properties of the contract. I’m not in US, but in my country some contracts types (including employment contract) imply “unless stated otherwise in the contract” copyright ownership remains on one specific side (for employment contract it is company). Such things might come from the Employment and Labor Law or Copyright Law.

Legal advice in company

I would not rely on company legal advice - not in case company vs you. Their responsibility is is to the company, not to you. Specifically legal department might be responsible in the future to carry on case against you. Although I wander if in such case an external law company is not hired - since lawyers representing the sides should probably beyond any doubt never ever represent the other side in any form or capacity.

Code was written prior the employment
It might not matter. Was it published at all? Is it publicly available? With what license? Does company know about that? Does company explicitly agreed to use such library? That might be some good or week points in you case.
I would say that contract that includes three points that I motioned above (in one form or another), makes it clear:

  1. you were employed to write code
  2. you pass the ownership of the code to the company
  3. it was your responsibility to deliver to the company a code that is free from any copyrights claims.
    [ So the company will be free to use it as it wish, and its IP is protected. You are paid to write a new code. It does not matter that company benefits from you reusing you code from your own project - in general it is not what you were hired for. And you agreed to that by signing the contract. ]

And here is the advice I received: reusing code - Never ever do that. (in casual discussion about projects in and outside company)

BTW, I recommend this youtube channel: https://www.youtube.com/user/ljfrench009

1 Like

You know the old saying, “loose lips sink ships” ? well just reword it to “loose lips sink scripts” and your there.

1 Like

I like that one, but it goes against everything open source thus defies how I believe code should be distributed :slight_smile:

yea but on the flip side you can make bank.

1 Like