I don't think that's a fair depiction of why people code on their own time. Some people just love making things, it makes them happy. I'm not young but still find the time to build projects in my spare time because I want to, not because it's training. I'd even go so far as to say I "have" to do that as I get pretty unhappy if I don't have some personal projects going where I can explore ideas and be creative. It's a side effect that I've learned a ton of valuable skills building personal projects and those skill directly translate into market value.