Person-centered metrics and self-organizing teams
We cannot reliably measure developers' productivity, and this is the major elements which pushes many managers to focus on less representative aspects of developers' contribution to a project and a company.
Some companies do a really bad job, choosing person-centered metrics: LOCs, time physically spent at the workplace, etc. Those metrics usually lack any correlation with the success of the project and the company itself, and are either irrelevant or simply harmful. They are good to give lousy explanations to the CEO about the reasons the project is six months late or to fire people without reason, and in long term, lead to best people leaving the company.
Other companies do a better job by using proccess-centered metrics which are actually relevant and often indicative of both the quality of the final product and the culture of the company: the number of bugs which hit production, the time between an idea and its integral implementation, the time between the moment the feature is implemented and the moment the users start actually using it, the technical debt, etc. Those metrics actually make it possible to improve over time, achieving faster releases, higher quality products and, unsurprisingly, higher team productivity.
When presenting those metrics to managers, they are often puzzled how would those metrics help them finding who in their team does a great job and should be promoted, and who should leave the company or change her role. This is an interesting concern, especially given that those same managers suck at hiring staff in the first place and succeed at encouraging the best developers to leave fast. What is even more interesting is that this concern makes them forget the real issues which should be addressed.
Managers in factories do need to promote and fire workers. This is their role for two reasons. Most importantly, nobody else could do that; if workers' jobs are purely individual, one can, in theory, work at a factory for years without talking to anyone, meaning that workers themselves don't have to know or actually don't know people they work with. The fact that there is usually communication among pairs outside the job is irrelevant. You won't be able to determine whether your colleague deserves a promotion based on a few philosophical discussions with him in a bar every Friday evening. Also, for some types of workers, individual productivity can be measured rather reliably.
This doesn't work for developers. In IT, it's not the individual productivity which is key, but the cohesion of the team, the communication, the creativity. Not only you, as a manager, can't reliably determine productivity of a developer, but also the team has much more to say about their member than you. They know the person; you don't. They work with this person daily; you don't.
This, in turn, means that manager's preferences for a developer when it comes to a promotion, or hatred towards another one when it comes to lay-offs, is used instead of facts about how much a person is precious for a company. This could very easily lead to discrimination, harassment, and other things which are not specifically indicative of a healthy workplace. In order to mitigate litigation, larger companies sometimes move those decisions to human resources department, which doesn't necessarily improve things. Human resources still need to rely on manager's feedback and on person-centered metrics which can be gamed by the manager and, as I explained, are irrelevant anyway, making their decision all but smart.
The solution to this problem is, however, quite straightforward. Teams should be self-organized, and decisions to join or leave a team should belong to the concerned person and the members of the team. Valve Software does that, and so does Facebook, and it makes perfect sense. Instead of relying on doubtful decisions from the management or human resources, why not letting people chose who they work with?
The greatest thing about this is that is solves a huge amount of problems which can't easily be solved otherwise. When I worked in a small French company in 2013, we had a group of a half dozen persons in charge of developing a new product. People were quite motivated, as far as they could have been in a discouragement-centered workplace, except one guy. He came at work, but remained there doing nothing. Not only was he particularly unhelpful, but he actually wasted our time, so we all agreed that getting rid of this person would be a good choice. The only problem was that the guy was our manager's friend, and going to the management and telling that the person should leave our team wasn't an option. And so he stayed.
When people don't chose who they work with, team synergy is lost. They unconsciously interpret it as that management doesn't care about team productivity, and so they wouldn't either. When people chose who they work with, they usually make smart choices which increase cohesion and make team productivity rock.
Unlike some managers believe, self-organizing teams don't impede management's job, but improve it. The choice is among the people who are best placed to make it, and those people should be rather good at making good choices, much better than their managers. This is easy to explain. For the team, it is crucial to encourage the most suitable persons to rejoin the team, and to encourage the persons who don't fit to leave the team. More interestingly, for the person herself, it is important to lean towards teams where the person could actually make the difference, and leave teams which are not a good place for her: naturally, a person wants to be in a place where her work is encouraged and where self-esteem can be high.
This leaves managers with hard choices about people who don't fit in any of the teams, but here again, self-organizing teams have their benefits. A person who was unable to find her place in any teams would probably guess that the company is not a good place for her, and accept more easily to leave. If not, well, the management has a strong point by pointing out to the person that she was unable to fit anywhere.