You hear of someone say "hey, wouldn't it be nice if platform X had feature Y?" You look around (on SO!), the feature really doesn't exist, even though it probably would be useful in many contexts. So it's pretty generic.

Your mind wanders for a bit. "How tough would it be? Well, it'd probably be just a snippet. And an ad-hoc function. And maybe a wrapper." And boom, before you know it, you've spent a dozen hours of your free time implementing a FooFeature that's really neat and generic. The kind of code you might not even have the time to spit and shine at work, that would be a bit rushed and not so documented.

So now you wonder "wouldn't this be useful to others?" And you've got your blog, maybe a CodeProject account, and your colleague who asked if FooFeature exists might, haphazardly, come accross that blog entry, had it existed before they told you. On the otherhand, the NDA agreement. It's sort of vague and general. It doesn't forbid you from coding at home, but it's clear on sharing company code, that's a big NO.

But this isn't company code. Or is it? Or will it be?

So, what do you do with code (that's more than just a snippet) you wrote in your off time with universality in mind but an idea that came from work, and that will most likely be used at work? Can it be published?

@FrustratedWithFormsDesigner I see your point, and I agree. As much as I care about the case though, I would not pay a lawyer's fees just so I can be sure I can publish open source code.
–
MPelletierNov 30 '11 at 14:59

You could also ask your company's lawyers, or if they don't have any on staff, raise the question with someone who can get the question to them. If there were a legal.stackexchange.com I'd have voted to migrate this question. ;)
–
FrustratedWithFormsDesignerNov 30 '11 at 15:09

Definitely not a lawyer but I would consider myself ok under certain conditions. 1) It is not tied to my employer's industry. 2) It does not use their Intellectual Property. 3) Coded it at home with my own tools. 4) I didn't write it with the explicit purpose of using it in a work project. If I cover that stuff I feel comfortable.
–
RigNov 30 '11 at 17:14

4 Answers
4

Questions similar to this have been asked before. It really depends on the employment agreement (contract) you have with your employer. My personal opinion is that if you did it on your own time outside of work hours, then you can do whatever you want with it, including publishing it as an open source project.

Your safest bet is to talk to your employer about what you have done and get their approval if you are unsure about how to proceed.

Thanks. I was thinking that would come up, "ask your employer". I'm not sure there are really that many places where an employer would say yes. I can only think of variations of "hell no!"
–
MPelletierNov 30 '11 at 15:01

5

@MPelletier All of mine allowed me to work on my own projects on my own time. Every last one. The only stipulations that I've ever had to deal with was producing competing products and creating products (even FOSS products) specifically targeting the needs of our customers.
–
Thomas Owens♦Nov 30 '11 at 15:04

For me, I can work on anything that I want to at home. I can even make libraries, publish them, and use them at work. However, I can't work on those projects at work. I also can't make products targeted toward our customers, especially those that compete with a product made by the company, even if I release them as open source products.

I've had plenty of ideas generated at work that I have or want to work on at home. For me, it's perfectly acceptable. However, depending on the terms of your contract, it might not be.

HR and legal at your work place are not working for you. The are working for your company and have the company's best interest in mind, not yours.
–
SardathrionNov 30 '11 at 15:02

@Sardathrion But they are the ones who know your contract and what you are currently allowed to do under it. If you aren't allowed to do what you want, then you need to take action to change the contract, if you can.
–
Thomas Owens♦Nov 30 '11 at 15:03

For sure. They need to be considered but if you really want an honest answer, you do need to talk to your lawyer first. Again, it depends what you can gain from this. If nothing, then it's hardly worth it. If it's the new youtube, then probably. ^_~
–
SardathrionNov 30 '11 at 16:02

@Sardathrion I wouldn't spend the money talking to my lawyer first. I would talk to HR/legal/ethics first and find out if it's against my contract. If it isn't, I don't need a lawyer. If it is and I don't like it, then I talk to my lawyer. Saves a lot of time and money.
–
Thomas Owens♦Nov 30 '11 at 16:05

1

That works (as long as you have a minimal amount of trust in your company) too as long as you can do with without alerting them to what you are planning/doing. Maybe I am just a jaded paranoid person... ^_~
–
SardathrionNov 30 '11 at 16:15

This is a terrible idea. Your employer won't just complain, but probably fire you and bring you to court. Once you're through with the legal proceedings, having to explain that you got fired for breaching your employment contract by posting employer-owned code without permission won't go over well in future interviews - I know wouldn't hire you, even if you were the most qualified person.
–
Thomas Owens♦Nov 30 '11 at 15:43

2

Tom, Do you know of a single case of this happening?
–
MoronsNov 30 '11 at 15:56

1

>> I know wouldn't hire you.<< With all respect, You are 23, at your first job out of school, What do you know about hiring decisions?
–
MoronsNov 30 '11 at 15:59

Personally, no. However, I've also worked under at-will contracts or in states that require employment to be at-will, meaning you can be fired (or quit) without any reason at all. However, I have studied business management (including courses in business ethics and business law) and this is a possible outcome. In areas where you are not an at-will employee, breach of contract is a common reason for dismissal of an employee.
–
Thomas Owens♦Nov 30 '11 at 16:02

3

Breach of contract is a NOT common reason for dismissal. Its a Common excuse to fire someone they where already looking to fire.
–
MoronsNov 30 '11 at 16:09

This varies widely based on location. In the US, there are generally two criteria: one of them (as @Bernard already mentioned) is whether you did the work during normal work hours. Another (that's often more important) is whether you did the work at the office or at home, and whether you used their computer or your own to do it. Generally speaking, if you did it on your own equipment outside of normal work hours, the employer would have to show specific clauses in an employment contract that said it would be theirs anyway to have any claim to it. If you did it on their computer at the office, the opposite would be true: you'd need to show some specific reason it was excluded from being theirs to have any claim to it. Using their computer at home would, from what I've seen, make it more of a gray area.

Throughout most of Europe, even writing it at home on your own computer gives you considerably less claim to the code. If what you've done is even vaguely similar to what you normally do for work, there's a pretty good chance that the courts would consider it their property.

I suspect Canadian law is somewhere between those, but offhand I don't know whether it's closer to US or European laws in this respect.

Regardless of the legality, I'd think a bit about how it's likely to affect your current job, and whether you're willing to put up with that. Even if it's technically legal, if it gets everybody who supervises you thoroughly angry, it's probably not worth it unless you really want to get a new job.