From a purely legal perspective, such an agreement probably would not have been enforceable. The coder would be giving up the right to his code, and taking on the burden of non-disclosure, in exchange for...nothing. Basic contract law (in the U.S.) requires that both parties receive adequate consideration (essentially, payment) for the bargain they are making. Unpaid student internships are generally not considered t…
It also fails to assign his existing work to the company (as contact terms cannot apply retroactively), which is a major blunder, as prior to signing this contact he could not be said to be an employee (if indeed he is).
The patent warranty is particularly ominous, anyone who signs that would be taking on enormous risk for the rest of the business's life.