The problem with suggesting this to people who are learning on their own is that building a portfolio takes time. Sure, if you're young and single, you could wait tables and learn to code. But it's more difficult to find the time as you take on more obligations with age.
The other problem is picking the right projects and languages that hold some appeal to the rare employers who will give you a chance. People are also less likely to cut someone some slack for sloppy code, due to lack of experience and knowledge, and other early coder problems.
The last problem is not being able to network successfully to find those less common employers who will give you a chance. And avoiding the bad employers who promise experience, but ultimately have them working as an on-call contractor who just reboots the printers.
Having any college degree helps a lot, but without it many doors remain closed even with a portfolio.
I got a great job with my second interview. How did I convince them to give me a chance? I didn't contribute to open source; I just showed them some of my personal projects. I had written a web based baseball simulation game, and I just showed them the code. I did a quick interview, explained how I had taught myself to program as a youngster, and they offered me a job.
In my years since, I have hired people just like me a number of times. Show me some code, if it is good, you are hired.