That sounds like an awful waste of 20 years' worth of skills and experience. I never saw this "check out at 35-40 and do something else" advice given in other specialized and relevant professions, but I can see how it may fit in the context of a jobs bubble where the industry can't sustain all the gold-rushers for their entire working life.
"That sounds like an awful waste of 20 years' worth of skills and experience."
Indeed. But then again, what can you say about a field where "senior" is commonly added to titles after 5 or so years?
If you're a programmer in the US and below the age of 40, I sincerely hope you investigate this before you find yourself only able to get consulting work. Or perhaps embedded, there are those who respect grey hairs in that field. Or government work; that's likely to be only attractive if you get a job requiring a serious security clearance, e.g. TS/SCI or Q, from an organization that's willing to have to mark time or whatever while you get it, then of course stay in jobs requiring a high clearance.
But this has been going on since at least the '90s, it has nothing to do with jobs bubbles, heck, it was strong at the height of the dot.com bubble, when I had my personal epiphany on it (was 35 in 1996), it's age discrimination. Or partly wage discrimination, young people, and/or those on H-1B and L-1 visas are cheaper, more malleable, etc. Google has provided one of the more notorious examples, https://en.wikipedia.org/wiki/Brian_Reid_(computer_scientist...