Is it ethical to make a copy of my work's source code, for the sole purpose of my own reference? By reference, I mean as reference where I can refer to it about how I (and my teammates) implemented various design patterns, architecture, etc. It does not contain any trade secret, product, secret algorithm or anything like that.

Note that I wrote many parts of the source code, and also the added value from me studying the code will also indirectly benefit the company I am working on.

  • 3
    This is more a legal than ethical question. Besides, remote access can be an alternative.
    – superM
    Jun 11, 2013 at 12:08
  • 1
    Do you mean to use it as a "reference" for non-work activies?
    – user82096
    Jun 11, 2013 at 12:12
  • 1
    It is ethical (IMO); though may or may not be legal depending on your contract and local laws; OTOH IME no one is interested looking at your code in the recruitment process
    – Balog Pal
    Jun 11, 2013 at 12:12
  • @dan1111 for my own study
    – Louis Rhys
    Jun 11, 2013 at 12:22
  • @BalogPal - Not 'no one'. I've only had one interview in 20 years, but I did have one where they wanted to see source code. I'm unclear what they wanted out of it, but some companies do ask. Note that I did end up working at the place. Jun 11, 2013 at 12:35

2 Answers 2


If you want to take code home but you don't tell at work and have to do it secretly it's unethical.

  • +1, that was my thought as well. If you are asking here rather than just asking your boss, that is probably a good sign that at least you think it is unethical.
    – user82096
    Jun 11, 2013 at 12:21
  • 2
    I don't think this is a good rule of thumb. You also don't tell at work and do it secretly if you're looking for a new job, but it's not unethical.
    – Louis Rhys
    Jun 11, 2013 at 14:05
  • @LouisRhys Edited the answer to make it more specific to taking code home.
    – Pieter B
    Jun 11, 2013 at 14:22

I think keeping a code example reference library from job to job is a good idea. It should be better than Google. I would encourage it if I was a boss.

  • tell your collegues about it and especially your boss
  • don't hide it, but you don't have to have it open on the net either.
  • ask about anything proprietary
  • exclude sensitive data and project names

Instead of having very broad design examples, I normally have a few lines of code or blocks to reference. A Factory Pattern example maybe but how much code is it going to take to show how to do BDD? There shouldn't be a complete application here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.