As a former programmer and programming manager, I was never focused on lines of coded (LOC) written. Programmers were given an assignment to write a program that did x, add enhancement y, or fix a bug in program z. It was the programmer's responsibility to come back to the manager with an estimate of how long it would take to do x, y, or z. Programmers were generally measured against their estimates.
It was of course possible to game the estimate. One could say it would take twice as long as it should, but that's the managers job to know what are reasonable estimates for x, y and z. If an employee constantly finished an assignment in half his estimate, it would become clear quickly he was sandbagging his estimates. The bigger problem was employees that would take twice as long as their estimate.
Again as a manager, it would become clear rather quickly who did poor jobs of estimating.
On a personal note, I'm currently volunteering with a non-profit organization. What I'm working on is involving several new technologies that I'm not familiar with, so trying to estimate the time required for various tasks is quite challenging.