About horrendous code, I haven't changed many companies so I wonder how many real world products that are some years old have code bases that are not some sort of a hard to figure patchy clutter if not down right trainwreck.
As for employees looking at my code, it isn't as straight forward. The code I upload to public repos like github are meant to be seen, used, extended and/or appreciated by peers, so letting potential employers look at them isn't a problem. However, when I mention that I have some personal projects brewing, which to me are potential business ideas, I would not let them in on too much detail much less look at the source code. Even if then agree to sign an NDA I wouldn't let them as I don't trust big corporations.