I often see programmers getting lured by the prospect of leading and managing teams very early in their careers. This typically happens in startups and small companies. Programmers with about 2-3 years of experience are asked to lead teams and they happily take on the responsibility thinking that they are growing very fast.
They couldn't be more wrong.
I have seen people grow too fast and then regret this later in life. Growth must be organic, the 'right' way. For people to be able to manage teams involved in technical projects, it is extremely important that they be technically competent too. A manager with superficial knowledge of the technology can never be effective.
So, when programmers have barely started their careers, it is imperative that they gain an in-depth understanding of technology before they start managing teams. I would say, a programmer must have atleast 5-6 years of experience in a very hands-on technical role before he takes on a managerial role.
Even after this, it will be very useful if he or she continues to code atleast for a few hours every day so that he never gets out of touch with the nuances of programming.
It is very tempting for programmers early in their careers to take on managerial responsibilities. There is a feeling of a 'promotion', a recognition of your abilities. This may be true. But in the interest of their career, it would be wise to defer this additional responsibility until they are really ready for it.
Managements of software companies must also realize this. Often they are left with no choice. Senior managers are expensive. Cheaper resources have the ability. So, why not? But in the long run, this is harmful to both. The company also stands to lose because good technical ability cannot be found easily.
By turning a programmer into a manager, you have lost a good programmer and found a bad manager!