Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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.

share|improve this question

marked as duplicate by GlenH7, MichaelT, Walter, gnat, Jalayn Jun 11 '13 at 13:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This is more a legal than ethical question. Besides, remote access can be an alternative. – superM Jun 11 '13 at 12:08
Do you mean to use it as a "reference" for non-work activies? – dan1111 Jun 11 '13 at 12:12
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 '13 at 12:12
@dan1111 for my own study – Louis Rhys Jun 11 '13 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. – Michael Kohne Jun 11 '13 at 12:35

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

share|improve this answer
+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. – dan1111 Jun 11 '13 at 12:21
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 '13 at 14:05
@LouisRhys Edited the answer to make it more specific to taking code home. – Pieter B Jun 11 '13 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.

share|improve this answer

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