Originally Posted by
matsp
And I doubt that unless you are specifically paid for such "previous work" and it's code that you have actually written as personal development, it would actually hold up in court. Certainly, a new employer would not have the rights to code you wrote for a previous employer - it wouldn't be yours to give away (or sell) anyways. And if they are hiring you to get access to code you wrote before they hired you, then they should really pay you specifically for that.
Obviously, this doesn't mean that the company can't put in the small print for the solution that the code you send will henceforth belong to them, just like many photo competitions allow the competition company to use your photos "in any way it likes, whether you win or not" - a good way to build up a large library of stock photos on any or all subjects... ;)
--
Mats