Ask HN: Using personal code at work
I'm developing a number of web applications for my university over the summer months in PHP. I've been working with the language for years, and have developed a number of custom database and template handling classes that I can hardly live without. I want to integrate these into the projects I’m developing over the summer, but I don't want to get bit in the ass if I use them in a personal project in the months ahead.
Has anyone here run into the same sort of issue as me? Is it a legitimate concern, and is there an easy way to address it? I'm perfectly fine with opening up/sharing my code with the rest of the world if that might solve the issue. Would a simple confirmation with my boss hold up in court?
21 comments
[ 5.1 ms ] story [ 63.8 ms ] threadSeeing as you are open with sharing your code, you can do it in such a way that it builds your cred as a coder, and it could even be a bit of PR for your boss (if you want it to be).
But I'd definitely sit down with your boss, and explain the situation. If you're with a small company, I don't see why it would be an issue.
Best of luck
You do need to give them pretty much open ended permission to use the code. A BSD license might make it easier, because they know how to deal with licenses.
If the code is closely related to their core competencies, it is much more complicated. For example, supplying trading algorithms to a bank.
If your code is really generic, maybe all you need is a comment telling where the code came from. Still mention it to your manager.
Aside: I consider it good professional practice to mention in comments the source of an algorithm or code snipit. Future maintainers will appreciate.
Placing the code in Guthub or Google Code will make it much easier to validate that it is truly open source and will allow the next developer on the project to download the latest updates.
Also it might happen that while integrating it, improvements to the open source code come to mind. Then it should be clear from the start if it would be OK to feed improvements created during employed time back into the open source project.
You will also need to be careful about contributions back to your open source stuff. This is one of the areas that open source foundations have done really well. The dojo and Apache foundations as an example have you fill out a contributors agreement to ensure the IP of any code that is submitted to them is "clean".
Or was it your ability to write that code?
Meaning: if I were your prospective employer, I'd be more
(a) concerned that your work product contains code that I do not have clear title to than
(b) hopeful that I will somehow grab the copyright of your pre-existing work.
You'll be a lot better off if the arrangement is clear beforehand, and don't sign anything that would alter or undermine that arrangement. People will have more respect for your being above-board and straightforward, and for the fact that you have enough self-respect to assert your proper rights while making a fair bargain.
A) Double-check your employment agreement for clauses that might give ownership of the code to your employer, even though you thought you were developing the code on your own time. (In some U.S. jurisdictions, overly-aggressive clauses along that line may be unenforceable.)
B) If you developed the code in question before going to work for your employer, keep an eye out for ways to demonstrate that fact. (In court, truth is always the goal, but what actually matters is admissible evidence.)
C) "Playing nice" is usually the best approach.
D) It's almost as important to be able to document that you played nice -- without being too self-serving in your writing -- as it is actually to play nice. That's because in court, judges and juries can sometimes be skeptical of the testimony of witnesses who have interests to protect; contemporaneous written documentation is often regarded as more reliable.
E) Assuming your employment contract doesn't contain any special language giving your employer the ownership of your code, a simple exchange of emails -- which you'll want to keep in your personal files -- may well do the trick. At a minimum, it would make a lawyer for your employer think hard before recommending taking any action against you.
F) If you're a university student, vice employee, the ownership issue might be a bit more complicated, but OTOH the university may be less likely to care about ownership than a company would.
(Usual disclaimer: Don't rely on this as a substitute for legal advice, consult a lawyer, etc.)
In terms of saving your ass for the future, I'd put a note in the source of the file saying where it came from initially, and keeping a copy of the email from your boss saying that it's OK to use that code (and expressly acknowledging that it's your code that you wrote before being employed with them).
Do watch out about transferring the other way, however - if you use these libraries and add to/modify them, you can't then add that new function to your "clean" version to use in the future (it belongs to the employer, even if you type it into your clean version off the clock). Also check the part of your contract/clarify with your manager about what happens to code you write for personal projects while employed - some companies have especially onerous policies about them owning that code, even if you weren't at work when you wrote it.
What I have often done, however, is write another version of basically the same thing, but only what I need for the job at hand. I never use the same program or variable names. I want it to look like I wrote it just for them, which technically, I did. Sometimes I bring a hard copy and sometimes I cut and paste a little from my gmail account, but usually I just rewrite most of it from memory (which is good practice, too.)
They're paying for me to write them software, they're getting it, and I keep what is already mine. Winners all the way around.
Except that you just took money out of their pockets to write something that you already had.
Now depending on the specific wording of the law and in your employment contract you may or may not be able to work on something related on your own. The only solution I can think of which would not require a lawyer and/or reading a lot of legalese is making a piece of paper in which you grant the company the right to use your software and the company agrees it's yours, and get your boss to put the company's stamp on it. That would work in pretty much all cases I can think of, and it's reasonably easy.
In my understanding, in general, if you are paid to do it and there is no explicit contract that says the employer owns your work, then you own the work. However, you must look at your contract with your employer. I am guessing you signed something saying the University owns what you do while you work there, most do. Universities are smart like that. It may be a sticky issue to say who wrote what and when, so probably best to avoid using your own code at work if you want to retain ownership of it.
http://duckduckgo.com/?q=%22work+for+hire%22
If I were in your situation, I'd take the opportunity to solve the problem in /another/ way, one that may be better. Worst case scenario, your brain gets bigger and you can still do things the way you were doing them before you wrote the new way for the university.
Are you considered a contractor or an employee?
I'd recommend talking to the legal department, or contacting someone you know in IP law(an actual lawyer, not some random HN reader).