I started by learning a low-level language
When I first realized that I wanted to learn to build web sites, I had purchased several books on the subject. They suggested that C++ was the language to learn to do web programming, so I bought a book to help me learn C++. (I learned later that that book was horribly out of date, which I'll get to in a moment.) I read the book and compiled the examples, but I also tried to bend and break the programs to try to stretch my understanding of the subject.
I then learned a "hot" programming language
As I just mentioned, that book was out of date, even 10 years ago when I first started learning to program. Few companies were hiring for it, and those that were looked for more experience than I had. I learned about the existence of C# - which is a C++-like language that was pretty popular at the time. However, since C# is essentially built on concepts from C++, I was able to pick up C# much more quickly, and have a much deeper understanding, than if I had just started with C#.
I got some experience
I had naively thought that being able to demonstrate knowledge of a language would encourage companies to hire me (or at least interview me). Not so much. I did manage to get a job at a music store, though, where I could do some programming. Luckily for me I had other skills, like knowledge of band instruments and experience selling items on eBay that they were looking for. But it was that first experience that showed me that programming in real life is not as simple as the books make it seem. I got to experience real-world programming first hand. I made sure to keep learning, though, since programming part-time wasn't giving me the experience I wanted as fast as I wanted it.
I finally got that first job - at a consulting company
Once I had some experience, I finally got a job at a consulting company. My first few projects weren't all that glamorous - I was helping implement a rather annoying CMS system for several clients - but I kept asking questions and kept learning. I also kept learning outside of work hours too, which meant that I was prepared when I was put on a more difficult project.
The advice I'd give to someone looking to get a programming job
I think that I stumbled upon a good method for creating good programmers:
- Learn a language that is the basis for a modern language - like C++, HTML, JavaScript, etc. Unlike me, though, you should have a general idea what people are hiring for and purposefully choose a related language.
- Learn a related language that people are hiring for - like C#, HTML5, popular JavaScript frameworks, etc. As someone trying to break into the industry, you'll probably have better luck with a language that few people want but nobody knows, than a language that has a lot of openings but a relatively large number of people to fill them.
- GET SOME EXPERIENCE!!! Volunteer to build something for a friend if you don't luck out and find a purple squirrel job like I did.
- Consider looking for a job at a consulting company. These companies are often constantly hunting for people who have a proven ability to teach themselves technology, since they are usually constantly learning new technologies to stay on the cutting edge themselves. You'll get a wide range of experiences with a range of projects and companies, which will help you decide where you want to be for the long term.
- Finally, KEEP LEARNING!!! This is true for any field, but is even more so for developers. Technologies change constantly. Programmers who can learn new technologies and can adapt to them will be employed for the foreseeable future. Those who can't (or won't) adapt won't.