I think you're referring to commonly accepted _usage_, not "correctness", when you say "code is always singular". The phrase "I write codes" (as in, "I write programming codes for a living)" is definitely okay/correct, IMO (for the reason given in my previous comment above) - though no experienced programmer with a good command of English would use it in normal conversation, because it's not colloquial. I was referring more to a situation like if he/she is talking to a layman and happens to use such a phrase, to describe his/her work. Remember, I said "strictly speaking" - and strictly speaking (in other words, pedantically), I don't think there is anything wrong with that statement.
But overall, I get your point. For a similar yet contrasting example, consider this real statement of an ex-boss of mine: "I can tell you what code to write, but I can't write _a code_!" which was both BS and grammatically wrong, of course :-) He did not stay my boss for long ...
I think you're referring to commonly accepted _usage_, not "correctness", when you say "code is always singular". The phrase "I write codes" (as in, "I write programming codes for a living)" is definitely okay/correct, IMO (for the reason given in my previous comment above) - though no experienced programmer with a good command of English would use it in normal conversation, because it's not colloquial. I was referring more to a situation like if he/she is talking to a layman and happens to use such a phrase, to describe his/her work. Remember, I said "strictly speaking" - and strictly speaking (in other words, pedantically), I don't think there is anything wrong with that statement.
But overall, I get your point. For a similar yet contrasting example, consider this real statement of an ex-boss of mine: "I can tell you what code to write, but I can't write _a code_!" which was both BS and grammatically wrong, of course :-) He did not stay my boss for long ...