I did an internship in a small software company in Germany and wrote mainly two programs, one which is just an example to learn the language which has no monetary value and another one which could be sold by the company if they finish a few remaining parts.
Now the internship is over and I asked my boss for a copy of the source code I personally wrote myself so that I can look up what I learned and have an example for this programming language.
I have no intent to republish the code in any way, including making it open source or selling the code itself or a product made from it. It's just the first stuff I wrote in this language and I would like to keep it as template and example.
He declined my request and said that they never give away their source code.
A quick online research taught me that if a program was written at the employer's disposition, they have the exclusive and full market rights. In my opinion, this sounds like they have the power to decide what I may do with it (e.g. prohibit selling or publishing), but it does not really say anything about the right to own a copy for personal educational purposes.
Other sources also said that the author always holds the inalienable (except through descent) copyright, so I as non-lawyer would interpret this in a way that grants me at least the right to own a copy, even if I may not republish it in any way.
My internship contract did not say anything about ownership and usage rights of the code I write.
I'm not going to fight for this, but I'm interested in my theoretical rights as employed (or internship) programmer. Do I have the right to obtain a copy of all source codes I purely wrote myself? What rules are there concerning this situation?