Andy Resnick said:
When a person develops a product under contract, the product belongs to the person/agency/corporation that paid the contract.
Legally in the US, the copyright for work that is written under contract is owned by the author unless there is a contractual provision otherwise. If you work as an employee, then it's work for hire which is owned by the employer. Also, it's very rare in the software industry have a contract if you work as an W-2 employee.
In any case, this is really different in the academic situation, where credit for a work is something that you can't legitimately sell. Curiously this is also true for the movie industry where there are rather elaborate rules for director and producer credit.
If I write code and freely release it, it becomes 'public domain' and I have no legal claim on the work.
It works the other way, once a code becomes public domain, you can do anything you want with it. Legally you can take my code and claim ownership of it. If you don't want that to happen, then you can put into under one of several licenses.
There's lots of public domain code out there- and some of it has authorship tagged in it somewhere. It's good practice to leave that tag in place.
There's something called the 3-clause BSD license that requires people to include contributors. The 3-clause BSD license has been phased out in favor of a 2-clause BSD license. The problem with requiring people to keep a list of contributors is that after a few years, you end up with these huge lists for small amounts of code.
You *do* raise another interesting question- do you automatically have a right to use/own products your company produces?
Absolutely not if you are an employee. It's work-for-hire which means that legally I have no rights. This poses a problem because if I want to show future employers samples of work product, I can't.
My guess is you can purchase it like any other private citizen, but you have no special claim on the product (i.e. you are not entitled to use it for free).
Except that most software is not for sale, and with consumer software even if you can buy the software it's useless without source code.