Of course incentives work, they just might not work the way you want them to!
The trick is deciding what reinforcers to use. What is a reinforcer? It is an incentive that produces a desired behavior. How do you know if your "incentive" is a reinforcer? You measure! Of course measuring is hard. As others have pointed out the easiest things to measure aren't always the most useful. Also, as other have already pointed out, any kind of measurement can (and, over time, probably will) be gamed. That doesn't mean shouldn't measure. You must use your brain to interpret the results, measure more than one thing, and continually try to improve your measurements and methods. There's a whole branch of psychology that deals with this called Applied Behavior Analysis. Unlike other branches of psychology (as espoused by Freud, Maslow, etc.) ABA deals with externally observable changes in behavior rather than attempting to determine the inner workings of the brain (feelings, wants, needs). I like to make the analogy with software development processes. Most branches of Psychology are analogous to defined software methodologies processes (Waterfall at the extreme) which are prescriptive and attempt to model development as a series of well-defined steps to follow to produce the desired result at the end. ABA is analogous to an agile approach (e.g. Scrum) which uses an empirical model by looking at the end result (working software, desired behavior) and modifying the inputs (requirements, working environment, incentives).
How do you know what to use as an incentive? There's lots of great incentives, but whether they work or not depends on the organization, the team, and the individual.
- choose the behavior you want to change (overtime, lines of code - caveat: I don't think these are very good choices, but they are easy to measure and serve the purpose of this example)
- baseline the behavior (use historical data if you have it)
- offer your incentive
- observe changes in the behavior
- watch for unintended side effects