I got my first programming job in 1979, at 19. Until I got to my 30s I mostly worked with people my age or older. I never had any trouble finding work and only ran into what I perceived as age discrimination when interviewing with teams of people a decade or younger than me.
It never bothered me to work with younger people, I can keep up, and experience still counts in most companies. I worked in Silicon Valley for a while, found my age counting against me there, but age didn’t seem to matter much outside of the SV environment.
As a freelancer my age never comes up, I don’t have to interview and sometimes I never even meet my customer in person.
Age discrimination does happen. On the other hand I’m not sure I would fit in to a team of people half my age. It also happens that people get older and set in their ways, resisting change and sticking to what worked in the past, and that trait will limit opportunities just as much as gray hair.