If he is an employee acting within the scope of his employment when he writes the code, the copyright belongs to the employer because it is a "work for hire". There is no need for a contract that states the employee surrenders his rights to the company because the employee doesn't have any rights to surrender--the employer is legally the author and it is in the employer that the initial copyright vests.