I've used several of my collection of snippets that I accumulated throughout the years of my programming career in certain company projects.

My case is this, I've also created several snippets during my working hours in a company and I am thinking whether it is acceptable to use those snippets in a non-company projects?

I've already asked my manager regarding this and he said that I shouldn't and I am fine with that and will obey his order. I am just wondering whether this is normal or not.

  • 6
    Are you serious? What is the upside of asking this question in public under your real name after your boss has already told you not to? Tread lightly with this approach. If you make your project open source, it may trigger some alarms with databases like blackducksoftware.com/compliance/code-scanning And note that some developers do the opposite of what you want to do, they develop software in a clean room situation, version controlling everything, time stamping everything, using separate hardware, to avoid their employer being able to claim ownership over their personal projects. – Stephan Branczyk Feb 13 '16 at 2:17
  • And when I say "clean room situation", I really do mean "attempted" clean room situation. I realize it's not really a clean room situation if you have the same developer working on both projects. – Stephan Branczyk Feb 13 '16 at 2:21
  • 1
    It is 500 % normal – Learner_101 Feb 13 '16 at 4:21
  • 4
    It depends what you mean by a "snippet". If it's large enough to be copyrightable, then it belongs to the company, not you. – Simon B Feb 13 '16 at 9:31
  • 1
    Use your judgement and assess the risk. If by "snippet" you mean a stanza of code that is not even a library nor a component (eg your favorite linq queries), consider how much effort it would take to go after you and what the ex-employer would gain by it. In most places enforcing a contract takes a lot of work and must therefore be very selective. – teego1967 Feb 15 '16 at 12:21

Consult a lawyer. I am not a lawyer. Your company is not you lawyer - they will give you advice that favors them. A lot will depend on the employment contract.

Typically the company will assert ownership of anything created on company time or using company resources. Copy paste is not legal if what you copy was produced on company time. That said if the code does not have other legal protection (e.g. patent) then just create it from scratch. They can't take away you know how to do it.

Some employment contracts may be so restrictive as to any (even on your time) software (or product) created during employment is company property. Like for a university professor this is common. Still if you wrote a generic snippet they cannot restrict you from recreating that - well they can try but I doubt it would stand up in court.

Code you copied from an outside open resource (like SE) is clearly not protected.

This is an example on legal advice. I was doing billable work on customer site. A person also on customer site was laid off. The contract was cancel-able and the customer just said fine we will cancel the contract with your (former) company and contract you directly. The (former) company told him he would be sued under the non-compete clause of his employment contact. He talked to HIS lawyer and the non-compete is void on a lay off. His lawyer talked to (former) company and threat of a law suit was immediately dropped and they told him they could not restrict him for working directly. Don't piss off your company for no good reason but also don't get legal advice from your company.

  • You can't swipe code without permission, unless the license permits it. You can reuse concepts, if they aren't company propretary. You really need to check your company's policy to be sure, but if in doubt, don't. – keshlam Feb 13 '16 at 16:42
  • @keshlam Swipe? The majority of code is not licensed. A concept is not protected just because it is proprietary. – paparazzo Feb 13 '16 at 18:11
  • Frisbe: Your contract with your employer usually has something to say about ownership of work done on your own time. Consult a lawyer indeed, but consult your contract and company policies first because that's the first thing the lawyer will ask you. You need to be able to show plausible clean-roomisolation or you need approval ir you need to be extremely careful. – keshlam Feb 13 '16 at 19:16
  • @keshlam Is "plausible clean-roomisolation" not just the same as "just create it from scratch". – paparazzo Feb 13 '16 at 19:19
  • Depends on how similar the two wind up being, depends on the complexity of the code in question... Creating it from scratch may not be enough depending on those details and contract. Frankly I'd be extremely careful if the company policy doesn't explicitly address coding on your own time, and I'd color within the lines if it does. – keshlam Feb 13 '16 at 19:25

I don't see why not, if you find a way of solving a problem and re-use it elsewhere that's only being efficient. That is now knowledge that the company has already benefited from, but it's also something you can benefit from.

I fail to see how you could be stopped, and if you came across the same issue and had to recreate the snippet from scratch it would probably be just about the same anyway. So long as its a snippet, not a full blown piece of a project.

Speaking for myself, I definitely re-use anything I have learnt through the years if I can. You re-use tools until they become useless. It's all part of your repertoire.

  • Recreate snippet and copy are not the same. – paparazzo Feb 13 '16 at 3:37
  • 1
    Only an imbecile would double handle work. If someone memorises an sql statement and then re-uses it at home he's breaking a law? There's no 'real' difference. Thats like saying I worked out a shortcut to installing a printer on a domain workstation, but I'm not going to do it because I worked it out when I had a different job. – Kilisi Feb 13 '16 at 5:03
  • Imbecile? Recreate and copy are not the same. So it I lean to thread a pipe and work and then do it at home I am breaking the law? – paparazzo Feb 13 '16 at 6:07
  • Using your logic you are breaking the law doing that, using mine it's perfectly alright and normal. – Kilisi Feb 13 '16 at 7:43
  • Really it is perfectly legal to just copy code but recreate is breaking the law? Are you an attorney? – paparazzo Feb 13 '16 at 10:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .