If someone made a piece of software for another company but never gave away the intellectual property rights or signed anything, could they use that code in other similar software? Could they sell it?

Assume that they were not an employee of that company and that they never signed a contract of any sort with the company, but that they were paid.