Malcolm Gladwell famously proclaimed that it takes 10,000 hours of deliberate practice to achieve mastery in a craft and Peter Norvig cited this finding in his article Teach Yourself Programming In Ten Years. A programmer will get in 10,000 hours of office time after 5.2 years of working 8-hours per day and 48-weeks per year. This does not mean that programmers will be an expert after 5 or 6 years because the 10,000 hours of office time is not all deliberate practice.
Deliberate practice is reading a book, learning a new language, taking a Udacity course, or solving a challenging problem that stretches your brain. Googling for 3 hours on how to manipulate the DSL of a Ruby Gem does not count towards your 10,000 hours. Some deliberate practice happens at work, but the majority takes place late at night and on the weekend.
If 40% of a job is considered deliberate practice (this estimate is probably on the high side for most jobs), than a programmer that works 8-hours per day and 48-weeks per year will only get 768 hours of deliberate practice in per year and it will take them 13 years to get 10,000 hours of practice. If only 20% of the job is considered deliberate practice (due to redundant tasks, meetings, etc.), then it will take 26 years to achieve mastery.
Hacker News commenters are also quick to point out that some people have 1 year of experience 10 times. The first year of work is a steep learning curve and is almost all deliberate practice, but subsequent years are repetitive, so there is no additional deliberate practice. These programmers never achieve mastery and are the programers that cannot program.
Deliberate practice is working on something that is just beyond your current skill set (i.e. figuring out how to solve factorial recursively if you don’t understand recursion). As your current skill set evolves, you need to continuously work on harder projects and challenge yourself. People who are disciplined, work on hard problems, and spend a lot of time coding are the ones that will achieve mastery in the craft.
I imagine that a web programmer 20-years ago would get 10,000 hours of deliberate practice by figuring out how to do stuff. Web developers today have access to powerful libraries and a lot of deliberate practice is dedicated figuring out how existing solutions work. Here is how a web programmer might progress with regards to authorization: create a Rails app with CanCan, learn how to make authorization from scratch from a RailsCast, create your own authorization solution in Rails, add authorization to the web development framework you created. These web developers will keep digging to get to the bottom of programming (i.e. what HTML does that Ruby code generate, what HTTP requests are being made, how does HTTP work…).
I did not start seriously programming until I was 27 and did not land a programming job until I was 28, so I have a lot of work to do before I am an expert programmer. I stay at the office until 10PM almost every day and try to get in at least 8 hours of programming each weekend to supplement the deliberate practice I get at work. Hopefully the discipline to the craft will put me on the fast track to becoming an expert.