I don't agree with that. At the time (8-13 years old) I wasn't eligible for work. Again it was also a hobby, meaning it was a fun passtime for me just like how regular people watch TV or go to the pub. That was before I had the internet and couldn't distribute the games/apps outside of my own school.
Think of it as a replacement to other passtimes rather than something that gets in the way, which is the image you're painting.
The same can be said for a friend of mine who loves animals, so she volunteers at shelters and such for fun. She doesn't expect nor want payment but she gains the experience as if it was a job (which is valuable) which would then enhance her application to any employer in the future.
OK - I just want to be clear. I am not saying it was "good" or "bad", or that I was for or against it.... that is judgement, and is personal, and while I would be happy to debate the merits of doing work for 'free' (or the penalties).... that would be for a different thread. I am merely trying to say that nothing is truly 'free' - that there is a cost involved. My examples tried to put a monetary cost, because that is what we are accustomed to measuring.
In your example.... you were coding for 'free' because you were not able to be paid to do it. However, you were inside coding (a sedentary activity) instead of outside getting exercise. The 'cost' of doing the 'free' work
may be that you are not as healthy as you would have been otherwise (I don't know your particular situation, so please take this as a hypothetical case). There are of course monetary costs to not being as healthy. (And 'health' is not just measured in whether you are fit or not. There is a lot of evidence now that many adult allergies are formed in childhood because kids are not exposed to the 'dirt' of outside. Their immune systems are not fully developed during childhood because the kids are too clean, and it later comes back to haunt them with allergic reaactions).
Your friend who works at the shelter is another example.... it costs her time. She feels that the time
spent is worth it.... but it is still a cost. Again, I am not arguing that what she is doing is wrong or right.... that is a judgement for her, and whether she feels that the time she spends not getting paid is worthwhile for her. But.... it is not free. The shelter doesn't get free labour either. There is an insurance premium that costs money. There are training costs, there are other costs involved...
but, they obviously feel that the value your friend brings is worth the cost. In this case, the 'cost' is less than 'value added'. Everybody is happy (except the tax people, who would wish that some sort of tax was able to be levied - another cost).