Don’t ever do this. Just a few reasons…
1. You say “during the application process”. Have you even met the hiring manager at this point? Worse yet, have you met “anyone” or are you just stuck in some automated process? Never forget that employment application is a two way street; you’re evaluating them as much as they’re evaluating you. They haven’t earned the right to see your code yet.
2. This approach should be a red flag to any applicant. They want to see old code to evaluate you when they are 64 better ways to do that? Something’s fishy here - someone has no idea what they’re doing.
3. Do not allow anyone to read your code out of context. You need to be there to explain the background, motivation, approach, and answer any questions. Cutting and pasting preempts yourself. Bring hard copy along only after the process has progressed far enough.
4. Only bad things can happen. This is like being the first the mention a number - you can’t win. If someone wanted to hook up with you but asked for a dirty underwear sample first, would you give one? This is the same thing.
5. If your code is proprietary, who knows where it could end up? You may also be violating confidentiality agreements. Not worth it.
6. The employer-employee relationship is a never ending tension. You will always be “negotiating” money and working conditions, whether you realize it or not. Giving in to such an unreasonable request so early in your relationship marks you as a chump. You may never recover the equal footing you need (and deserve) in the ongoing relationship.
7. If they have a problem, move on. You’re probably saving yourself a lot of trouble down the road. You sound like a competent developer who should have no trouble finding a job without bending over. So don’t.
[Aside: Because of this kind of thinking, I never give references before being hired. In essence, I’m telling the prospective employer, “You decide.” They then have the right to rescind the offer if they don’t like a reference.]