1) Define structure
Set some rules. Coding styles, check-in etiquette
2) Find tools to limit mistakes
Static code analysis, automate build that breaks when #1 fails.
3) Always on alert
Do a lot of code reviews. A lot. Argue and fight over little things (variable naming convention, missing documentations, unclear code).
Now this might not sit well with others so get ready:
4) Become a "drill" sergeant
I find that becoming the "bulldog" sometime works. You've got to become some sort of "drill" sergeant. People may dislike you at first but if the project is successful, they can hate you all the way to the exit door all they like.
That was my experience. I made a concious decision to put the success of the project as the top priority. Even if it means breaking some bridges with other programmers. I hope they learn why I did those things in the future. If they don't, I won't quarrel or regret my action.
5) Be nice on other occasions
I may be the biggest jerk during code-review and check-in commits but when my co-workers stuck, I'll be gladly help them even if it means I have to sit with them and do my overtime. This can gain you some respect after confrontation/intense debate/being a jerk.
I always try to be friendly during office/release party. Give credit to the team, etc.
What's the #1 thing people are afraid of? Public shame. I have a theory that Scrum primarily works because of this. Just have daily Scrum-light meetings with your group. If you have 15 minutes with a group of 5-6 people and everyone has to say either "done" or "not done"... the not dones will of course have some silly excuse, but because of the time constraint you must cut them off, be curt, and say to the effect "so John can you help Dan with that right after we break?". And then everyone would make commitments on to what they would do that day. I guess in a way you can say this was being a drill sergeant, but the thing was I wasn't an a-hole, that 15 minute meeting every morning was just part of the process, it was expected.
After a few weeks of this everything moves at twice the speed. I had a team of 6 devs (including myself) burn through nearly 200 bugs in 2 months. That's every engineer fixing about 4 bugs a day. There was a hug chasm of talents on that team... we had the top guy in my dept as well as one of the weakest engineers on the same team. Everyone performed.
I guess, I am not a super good "drill" sergeant, though. All I can do is leading by example, mainly doing a lot of pairing. But that is time consuming, so I might try to develop more of a sergeant attitude.
Volume. You are forgetting (and/or haven't been privy to) all their failures. Statistically if you do 100 things 1 or 2 of them will be amazing, the rest are crap. We've seen publicly a few of those companies' failures. I'm sure there are many more we haven't.
They haven't managed jr devs any better than the rest of us. They just brute forced it with shed loads of money and people.
>> it's so hard to actually find good senior programmers
Most of them either find jobs through referrals, or have become consultants in order to avoid the unwritten rule in many companies that you can't make a higher salary than your manager (yes I know there are exceptions).The most effective teams I have worked on at Google have a healthy balance of experienced and inexperienced engineers.
Senior engineers are in extremely high demand at places like Google and Facebook precisely because of the points you bring up.
I am in the 5th year of leading development teams and have more than 5 years to go until my half-life is over. Yet, I have not figured out how to run a team entirely of junior programmers. Yes, they come with a lot of energy and current knowledge but there is also so much missing that people gain from, well, experience. In the field of software but also in all the adjacent domains that are so crucial for being successful as a team. I cannot image how I would do without having a few senior people around who can give things a little structure and a little broader understanding of things.
Also, most experienced folks, even if not super up-to-date with fancy technology, are a hell of a lot more productive than the shooting-from-the-hip youngster. They don't need to put in 12 hour days.
My other problem is that it's so hard to actually find good senior programmers. There are also a lot of people who got stuck more than ten years ago ...