How is 10 years not also planned obsolescence?
Honestly, I'm fine with seven years after discontinuation, as long as that is stated at the time of purchase. The expected lifespan of a desktop or laptop computer is 3-5 years, and 7 allows a bit of a stretch for those with limited needs or maybe the second owner of a device (if the hardware itself lasts that long, which is less likely now with soldered RAM and SSDs). It's not like the machine blows up in a puff of smoke at the 7-year mark. You can certainly use an unsupported OS or install a different OS. It may not be "safe" or "approved" for business use, but it would still be a perfectly good machine for a child to use to learn programming.
Besides, most people don't really want to use decade-old computers, anyway. Technology progresses more slowly than it used to, but a computer from 2015 isn't really usable by the average person for typical tasks. Sure, a nerd/geek/hacker type can find a use for it, but those types also know the risks of running old, unsupported hardware and software and know how to mitigate them.