Outside the valley you find a plenty of really competent programmers mostly in there late 40's along with a few people that are nearing retirement age and while often gruff tend to blow your minds. As in "we stopped testing his code years ago." Or just calling someone team _. As in you could get 15-30 people working on a project or if your lucky Bob.
Theory: This importing of workers has negative effects on age and gender diversity, since it means a higher proportion of jobs go to people who can easily relocate for work. That includes young people (who are less likely to have kids and/or spouses) and men (who more often receive the primary or larger income in a household). I'm sure you can think of other things that are advantages or disadvantages when it comes to moving to California for a job.
There are ways to test whether this effect exists and how large it is. For example, you could compare age and gender diversity across industries. The theory predicts that age/gender imbalance is correlated with geographic concentration of employment growth for each industry. You could also see whether these imbalances are worse within industry hubs, compared to companies in the same industry outside the hubs. (Though the effect can also spread outside the hubs if it influences a culture that gets exported to the rest of the industry.)
I'll bet geographers or sociologists have published research on this subject, though I don't know enough to search for it effectively. (I found some vaguely related papers on Google Scholar, but nothing yet with data that would directly answer these questions.) There are some historical parallels of course, like gold rushes and resource extraction booms that cause new industries to grow suddenly in a particular area.
The need for developers is so strong that all the major tech companies are devoting resources to recruiting as soon as developers graduate.
That dynamic could account for a reasonably large part of the age imbalance in the industry. If there was a similar-sized pipeline of recently-trained developers with a more diverse age group than university students the story would likely be different.
You will see the following in experienced, good consultants as well. A lot will go wrong on a gig that is not anticipated during the initial scoping of the project. The inexperienced (often but not always correlated with youth) will "freak out". Whether it is a passive flip out like analysis paralysis or a more overt one, the end effect upon management/clients is still unpleasant for them.
Even when I was much younger in the field, I observed some of the older staff tended to have an imperturbability and unflappability about them even when presented with unexpected and unwelcome challenges (read: emergencies). They often didn't know what the solution was, but had enough taste and experience to know where to start and to start Getting Shit Done. This meant picking a likely direction of troubleshooting and just start walking a breadth-first search of causes, then a depth-first on anything turning up from the breadth-first that looked promising. Easy to describe in these antiseptic terms and comfort of your keyboard, hard for many younger developers in the heat of the moment when there is a frantic manager beating them about the ears that the company is about to go under if they don't fix this "right this damned second!".
This points out another observation I've made about managing younger developers. Do not mistake their energy level and enthusiasm for the degree of emotional and verbal abuse it requires to engage them. It might be different for other industries and positions (I doubt it), but too many times I've seen people take the easy way out and subscribe to the Management by Berating school. Also called the Management by Complaining/Screaming/Browbeating school. You can mention the dire effects some emergency has to the younger crowd to establish context, but move on from it and don't use it as a way to urge them on to fix something faster. Most younger developers simply do not possess the life experience to easily tamp down the anxieties they feel and set them aside long enough to dispassionately fix the problem at hand if there is management at their desk anxiously wanting blow-by-blow updates.
This doesn't mean you simply dump the problem in the younger developers' laps and walk away, either. Neither extreme is good for your team or organization. Lead by example with a calm approach to working the problem, either make decisions on where to start or support your senior leads with their educated guesses with where to start (and if you don't know where to start and don't have senior leads to turn to, you've got bigger problems), triage the effects with mitigation tasks, assign bite-sized tasks to the less experienced developers as your judgement advises, create a big picture view for yourself with the best information available of where your team stands with the problem, clarify the picture as you go along, and run interference from the rest of the organization's managers who Manage by Dysfunction.
A side note for younger developers. The only partial shortcut to that unflappability I've had experience with is to secure yourself 2-3 years of living expenses as soon as you can. It helps you achieve perspective, especially when a manager yells you'll lose your job over something. It isn't a replacement for experience, taste, judgement, whatever you want to call it, but it does help a lot with compartmentalizing the emotional component of facing down stressful situations at work, which takes most employees a decade or two to learn, and some don't learn it at all.
Are you sure you are not committing the same ageist judgement here?
One is an active reverse discrimination that is attempting to tilt the balance back (often enforced with some kind of law or policy). This has all kinds of well-known problems (that arguably are larger than the benefits).
The other is a more natural reverse discrimination that comes from collecting the missed opportunities of your competitors. If your competitors reject candidates for frivolous reasons, then it's easier for you to hire qualified people. I think this is what the parent comment was doing, and it doesn't strike me as a problem.
The tooling accessible to people today as opposed to those that started 10 years prior is also extremely different. Running Windows? Trumpet Winsock, understanding the win.ini, config.sys, and autoexec.bat were important. Linux - a lot of people have wasted a lot of time getting sound and video drivers (as well as xf86config files) to work right, most just work fine now. All these required a level of digging that required knowing more about the system than you may have wanted.
Not saying your point isn't valid, but it does depend on what one's definition of "competent" is.
Enders Game is a good allegory for this.
It's good to have diversity and meritocratic process for decision making. It's good to have different perspectives, but recognize that sometimes bad experience is worse than little experience.
Prove it with some research. The current research shows that people really don't make their best contributions to their field before 35-45.
And, to be fair, I see more young people who attempt to hit the screw with a hammer because a hammer is the only tool they have.
Look at someone like John Carmack - before he was 35 he had done Command Keen, Wolfenstein 3D, Doom, Quake 1-3. Guys like Steve Wozniak were basically out of the business by the time they hit 35. Linus released Linux when he was 22, and started git when he was 35. I doubt guys like Marc Andreesen have written much code since they hit 35 as well.
So, basically what you're saying is that young people can churn out software where you can undo your huge screwup, but if you have to get it right the first time like hardware, then you need some experience.
You are the one with a "platonic causation", namely, older = rigid thinking.
Enders Game is a child's book, written to appeal to children. Note we don't actually have 9 year olds making decisions in reality.
What you're saying is that some people don't learn from their experiences. You should focus on finding out if they have. That's worth way more than hoping that this young kid will.
Good developers do use pattern matching. But good developers just use it as a way to come up with ideas, and they use their experience to judge the ideas.
There's no such thing as "bad experience", just poor reasoning skills. And mostly people will improve their reasoning skills over time. Unfortunately, not always.
No way a 40 year old guy have more experience than me in general programming, unless he was working at Microsoft or IBM at that date, and surely they are about less than 10000 of those guys in the world. Of course there are 40 year olds that may have way more experience than me in a specific language or technology.
My point is that if computer tech is only 30 year old, then you won't find programmers with more than 30 years of experience, no matter their age.
There was lots of stuff going on with the DEC minicomputers, LISP machines, early UNIX systems, and big-iron mainframes long before most of us were even born, let alone getting our starts on TI-99s, Apple IIs, and Commodore 64s. And let's not forget that the people who were creating those early home-computer platforms were themselves all from the previous generation.
Would you turn people like Steve Wozniak or Al Alcorn or Ken Williams away from your new startup? You'd be a fool if you did. The basic architecture of computers hasn't changed at all since they did their most important work, and the cognitive skillset that makes a great programmer is the same as it's always been.
In fact, I'd expect that people who cut their teeth on early systems, and had to work within narrow constraints, without a big stack of abstraction layers and frameworks, would be all the more adept at writing robust and efficient code than those who learned on modern tools. And I'd bet, with Moore's law slowing down, and with better-optimized code becoming more advantageous in building scalable systems, older programmers will soon be in higher demand.
(Not trying to short-change Bartik here either -- she did a lot of the work on the ENIAC instruction set when they converted it to a stored-program computer)
Edit: And many more "giants", of course…
I think that it would be a mistake to say that computer science has truly been around for 160 years, though. A few people (there was also an Italian who was interested in Babbage's work, although I'm not sure what his contributions ended up being, if any) does not a field make, and the fact that any progress in it was more or less put on hold until the early 20th century (when mathematicians started working on what you could calculate or construct in a finite number of steps), and you didn't get (untyped) lambda calculus and turing machines until 1936, which is probably the best place to truly start the idea of computer science as a field. (And since you got early devices that were sort of primitive mechanical computers in the late 30s, early 40s as part of the whole Bletchley Park cryptography work by the Brits.)
A very large debate around the turn of the century was if mathematics that you couldn't specifically construct in a finite (or countable) manner were, which became particularly heated after Cantor's set theory work (showing that the real numbers were uncountable) and then things like Russel's paradox (showing contradictions in Cantor's naive set theory if you allowed sets that contained themselves). I'd argue (without firm, researched proof that it was definitely the intent and case) that the spirit of early computer science (lambda calculus, turing machines, etc.), which was concerned with what you could and could not compute with a finite algorithm, came in spirit from those sorts of debates. (See finitism, intuitionism, constructivism, etc. for parts of this debate; traces of it remain in modern day mathematics with some people's concerns about if the Axiom of Choice is a valid or reasonable axiom to have)
ENIAC was ininitially put to work calculating artillery trajectories, once the programmers figured out the bug where the shell kept going after it hit the ground (oops!).
I started programming toys in 1979.  I started programming "modern" computers in 1981. I was selling games when I was 15 in 1983. My "real" professional experience started in 1987 with a contract to write a video game from a major publisher.
So yes, it's not hard for someone to have "more experience" than you in general programming.
 I had one of these: https://en.wikipedia.org/wiki/Big_Trak
Do you know how many people were doing that? you are way over estimating the amount of people in the world with your experience.
You said "No way a 40 year old guy have more experience than me". To disprove an absolute statement you only need one example.
That said, a significant fraction of my friends from those days were doing similar things. I won't deny that I'm particularly good at programming, but all of those friends could also claim more experience than you.
I've heard a number of these comments recently drastically underestimating how long computers have been around.
> No way a 40 year old guy have more experience than me in general programming, unless he was working at Microsoft or IBM at that date, and surely they are about less than 10000 of those guys in the world.
You're talking about 1989, right? In 1983, there were 443,000 computer programmers and 276,000 "Computer systems analysts, scientists" in the United States alone (source: http://www.census.gov/prod/2/gen/96statab/labor.pdf).
I'd be really interested as to how you get that figure...
If you were using one at age 10 and are now 35 that would have been 1989/1990 or so... there were no magazines writing about it by that time. You had some old issues of the TI-99er or something?
So it makes little sense to suggest that it's somehow a crazy idea that someone 5-15 years older than you (in their 40s) might have a longer track record working with computers.
Working in a bank, not for an editor...
FWIW, I'm 47 and was programming assembly and microcode in my youth. So I have 10 years on you. At this scale, I doubt the difference matters much. Because you are old, too.
Also, you have about 30% more experience than me, I don't think it's a small amount.