Originally posted on Postlib.com.
Caveat: I'm not a lawyer so take what you read here with a grain of salt. However, the specific laws below should be of interest to anyone seeking to produce their own creative work.
Copyright inherently applies to code (once it exists in a fixed state like a file).
Like creative work, copyright applies whether or not it is explicitly copyrighted or licensed.
Due to the cost and difficulty in registering an entire production-worthy enterprise code-base (and every change made to any of those files) many companies will opt to avoid this issues and adopt an open-source posture:
Many companies will wait to sue until a violation is worth pursuing in court (due to the immense legal costs and time such cases can often accrue).
Others have adopted a more enlightened approach (whereby they recognize the value of intellectual property but share it through partnerships). That may come as a surprise but a lot of companies have found that it's more valuable to share their intellectual property than fight to keep it to themselves:
In some cases, legal disputes will arise nevertheless:
Consider the high-profile civil case where Oracle sued Google over reusing and distributing its open-source software in the Android SDK. Oracle sought $9 billion in damages.
Originally, the courts handed the case to Google arguing that no violation of intellectual property had occurred due to "Fair Use" (which also allows teachers, for example, to copy works without direct permission for purposes of teaching).
However, an appeals court over-turned the initial decision and the case is back in court.
These grant patentable projects to be built on top of the code as long as the licenses remain and novel functionality provided. To make code use-friendly, attaching a license is preferable and usually a requirement of the licensing regimen. Furthermore, these licenses grant explicit copyrights to the enduser.
Check out: choosealicense.com/
Essentially, these states mandate that if you do something on your own time, on your own equipment, and that's not directly related to your main employment - it's yours, no matter what documents you sign: