Schools see programmers as a money making industry for them, so they mint new programmers as fast as they can (regardless of ability). People in other industries move over to programming because there is such a demand that you can even get a job without any qualifications. The end result is that even while demand is outstripping supply, the vast majority of the supply is under qualified to do the job. Employers burned by under qualified employees agree to spend more and more money to hopefully find the needles in the haystack. If they collude to agree not to pinch each other's needles they get their hands slapped ;-).
Even if there is a world-wide economic downturn (like we just experienced), it plays into the hands of high salaries because under performing companies dump under performing employees on the market making it even harder to sort the wheat from the chaff.
It's a bit like professional sports. There is an endless supply of people willing to play sports for a living. The competition to get the best of the best drives salaries up for everyone who gets a job. I was surprised to learn that one of the Japanese soccer players that I follow who has been sitting on the bench of a poorly performing 2nd division European team for 2 years is making more than $1 million a year.
However... although I don't see salaries going down for a very long time, I do see it getting progressively harder to get a job. Perhaps, as you say, like the lawyers. I think businesses are going to want to get value for their money and similar to the sports industry I can see a much more laissez faire attitude towards employees. Produce and you can stay (maybe). If we don't like you -- for any reason -- we'll dump you for the next guy.
Maybe I should become an agent...
edit: a word
I also did an interview on Above the Law about how some people in the legal profession may be better off in software: http://abovethelaw.com/2015/06/should-you-leave-law-and-lear...
And for the record, the majority of new lawyers in the United States are paid as much if not less than an junior software developer these days.
I think the assumption that you call out yourself(64 yo developer) is the main difference over a lifetime of work. How many developers are going to be finding much work over 45-50 unless they are already well positioned as an independent consultant or have a name brand? That's 15-20 years more earning potential for the lawyer.
The other thing is the startup x-factor. Because so many start ups fail studies have shown developers that go the startup career route actually make less on average than their counterparts working for larger established companies. Very few people have the drive to make partner at a large firm but even fewer people are lucky enough to be an early employee at a company that makes their equity worth more than a years salary.
Why exactly is this? And why would anyone go into a profession where they will be unable to find work when they are half way through, and at the peak of their powers? In every other intellectual enterprise--doctors and lawyers particularly--they hit their peak earning years just as software developers because (supposedly) unemployable.
This makes little to no sense. It isn't like good older developers become magically incapable of learning new langauges or frameworks. It isn't as if they become less reliable than a 20-something just out of school. It isn't as if they suddenly forget 25 years of history that lets them make more accurate effort estimates than anyone else.
So where does this perception that developers must be young come from, and why does anyone go into a profession that by definition (apparently) is going to require the to change feilds mid-career?
I suspect it is that people think they are less flexible and less willing to work unsociable hours though.
The problem is this: If you have more than 20 years of experience and want to continue being a employee programmer you only have a few choices. You can advertise yourself as a senior programmer and try to command a senior salary. Or you can advertise yourself as a more junior programmer and ask for a low salary. If you have the ability to do the senior position, then there is not problem. If you do not... who the heck is going to hire someone with 20 years of experience who is still performing like a junior? Even if they are cheap, there is value to the employer of imagining that the employee will develop over time. Someone who flatlined 15 years ago is not someone you want on your team.
The moral of the story is: if you want to be a programmer for your whole career you need to stay on the front edge of the industry. You have to work your butt off day in and day out to not only stay current but always improve yourself. There will never be a day where you "make it". You will have to justify that senior position that you are going to occupy and show that you are better than the up and coming young wolves behind you. If you are not prepared to do that, then you are better off not being a programmer.