Lines of Code? We've been down that road, and it doesn't work well. Especially if you improve the project by deleting unneeded code - did you just do negative work?
Features? Some features are wildly more work to implement than others.
Bug fixes? Besides not being a sufficient measure of work making new code, making a bug fix the work metric penalizes conscientious programmers who find and fix all their bugs very quickly before they check in, or if they report them then they're wasting time writing about bugs that took less time to fix than they did to write about.
I think in an ideal world programmers should get paid by work units, but I don't think there's a way to measure it that doesn't create more overhead than it is worth. In the end, people get paid by the hour not because it's be best way, but because hours are easy to measure.
Conformance to rigid specifications is not the way to go.
But that's not true for supporting jobs (e.g. secretary) where it's up to your cost accounting whether you pay for time flat (monthly) or by workload (hour).