I agree it's depressing, but if your goal is to continue
"programming" past age 35-40 I'm not sure you can make the case for others. See my other posting discussing autodidacticism.
However, there is one caveat: if you go into embedded or get a serious security clearance and stick to government work that required it, you can with much less difficultly continue programming. In the former case the field appears to respect gray hairs, in the latter, it's pretty hard to get the first job (they can't have you working on classified stuff until you get your clearance and you can't apply for or hold one without a job requiring it) so once you have your "tickets" you're in very good shape.