Emily Gover, MSIS, Librarian and Ed Tech Community Manager
The amount of time it takes to become an expert in a certain subject is debatable. In pop culture, many reference author Malcolm Gladwell's "ten thousand hour rule" from his book Outliers (a fascinating read!). The rule essentially suggests that, to become an expert at seemingly anything, one must dedicate an average of 10,000 hours of "deliberate practice" in that discipline. That said, other articles and studies have come out arguing against this theory, and Gladwell himself has further reflected on the discussion around this idea.
Anecdotally speaking, it is entirely plausible to teach yourself computer programming to the point where your expertise makes you a desirable (and employable) programmer. A handful of co-workers at my job are amazing developers, but, say, majored in History or Public Policy in college, and only did programming as a hobby.