This is generally true. It's a combination of many things, from brain "degradation", ageism, simple economic math ( fresh meat is cheaper and more malleable ), other more important interests like having a real life and when you really mute all the marketing BS, your delusions and wishful thinking, the actual work of being a developer/programmer in a professional setting is a really shitty job and sad life for the maj…
> brain "degradation"
At 40? If you're suffering from loss of mental capabilities to the point that it affects your performance at work at 40, you have medical issues that need immediate attention.
> simple economic math ( fresh meat is cheaper and more malleable )
I've seen this stated many times, but nothing is forcing anyone to offer a particular salary or demand a particular salary.