I spent 20 years contracting in Silicon Valley after working for Apple in the late 80's. I could tell lots of stories relative to the OP's question, but I am going to boil this down for you young whippersnappers who are going to down-vote this post no matter what. I found a few reasons why OP would ask these questions:
1. Some managers, particularly under age 40, are assholes who, even in this connected age, if they can't see you typing away all day, right under their noses, believe you are "not productive", a term others seem to toss around in their answers. What is productive? 100 lines of code a day, or 20 lines that actually work? What proof? Well how about the silly ass religious adoption of "agile" methodologies. How can everybody look over each other's shoulders if they aren't all in the "hive"? Clearly, these managers have never worked with someone with serious experience. The mania for groupthink management has always originated in academia, where the rubber meets the sky when it comes to shipping anything more than research projects, not real commercial work.
2. Managers hiring "older workers" object to paying them nearly as much (or more) than they themselves make. The younger the manager, the worse this is an issue. They prefer to hire people younger (and cheaper) than themselves.
3. Younger managers don't possess the life experience to appreciate hiring people who are smarter or more experienced than themselves. They feel threatened by experience, not appreciative of it. And they are naively convinced that hiring two younger, cheaper guys is a better bet than hiring one, more expensive, more experienced one. They end up with crap code that maybe works and rarely scales or is resource efficient. I made lots of money mopping up after exactly these kinds of failures.
4. And lest I come off as a "young manager hater", most older managers suffer from some of the same issues, particularly the "I don't want to pay you as much as me" and "I don't believe you are working unless I can see you". But they are even less likely to hire offsite workers, frequently being utterly ignorant of the collaboration technologies that are in common use today.
So I don't believe there is any misconception about there being age discrimination in the business of software development. I have seen it first hand. But being old or having 30 years' experience does not give anybody a right to a job. You have to have relevant experience. I figure everything in this business is obsolete in about 3 years, so anybody who has more than 3 years of experience has to have learned new technologies in order to remain relevant. This cycle never stops and it gets shorter every year. But even if you have the latest tech under your belt, there are still age and location to consider. I beat them by remaining current, networking constantly, and living where the work is. Anything less will make it harder. But that doesn't invalidate the points above. Of course, YMMV.