However my preference, and it seems the preference at the companies I've worked with, is to have a mix of folks have recently been exposed to something new (often recent graduates but not always) and people who have made lots of mistakes on other peoples' dimes (boy, have I made many over the decades).
In fact in my most recent startup we did a SWOT analysis just when we decided to get going and one of the strengths was "old farts" (5 of us ranging in ages 45-55). One of the benefits was all the mistakes we'd all made (and successes), one was that each of us had already worked with at least one of the others before, one was the depths of our networks, and because of the years of doing weird shit, we didn't have to try for "cultural fit" -- you couldn't guess from the outside that we might have (no stereotypical cultural fit; we include a hippy and a prepper/gun-nut, Americans and immigrants) it yet we all get along like a house afire.
And we'll be looking for the same in people we hire: do they know their shit and do they know what it means to screw up? Sometimes you find that in a recent graduate, but you're more likely to find it in someone who's been forcibly humbled.
Reminds me of some years ago, when I worked with a very talented and ambitious young tech manager, who was impatient and constantly frustrated by the hangups of corporate development. A couple of us old farts were talking about him one day, and one said that what he needs is a proper Death March.
There's something very sobering about being trapped onboard a sinking project, with everyone panicking and overworking, knowing that it's doomed and there's not a damned thing anyone can do about it. Teaches you that rushing doesn't help.
There's definitely a lot of age bias in the employment, particularly after ~40. The key is to move up the difficulty ladder. Your age-resistant employment prospects skyrocket if you move away from lower value skills - think PHP - and move up to (just for example) Java or Go et al.
Or move away from low value front-end junk that turns over every three years (the latest JavaScript framework of the month), and to higher value serious programming. That's where long-term job security comes from. The difficulty acts as a barrier to entry against a flood of low skill labor that will constantly undercut you (both in regards to age and income). Master a high value, higher barrier to entry language or two and you can write a six figure ticket for the rest of your adult life. And as certain languages begin to themselves age off, the demand often only goes up for the dwindling supply of engineers that still know it well.
I feel my contribution is more in saving time by experience than anything purely programming language related. Instead of having ‘young people’ ‘iterate, move fast and break things’, I think up the basics and tell them that. It save stress not knowing what to do (in my opinion the iterating is just their way of figuring out what to do without that feeling you are wasting time; it is not a very efficient way as there is a limit on how fast you can iterate and in how many simultaneous areas) and less crappy software comes out as the iterating did not start in the completely wrong place.
I almost agree with the poster above, but I think it's less about the languages than high-value skills or specializations. As long as you're defining yourself by a language, you're more limited than someone who's known for expertise in some specialty.
Examples include distributed systems, realtime software, embedded programming, network programming, etc.