Right, agreed. So, once upon a time we had typing classes. Would you then expect the typing teacher to take on teaching shop and engineering courses that were about how to build a typewriter? No.
Actually, yes, but probably against their wishes. (But their alternative is being made redundant, so can you blame them?) My dad started as a woodwork teacher, which was replaced by engineering drawing. He'd failed his A level at that, but his school presumably couldn't find anyone else to teach it, and asked him. Apparently it was a stressful summer learning. That was more gradually replaced by IT, meaning "using software", which I think he did quite well at -- "using software" had the flexibility to mean using art + design + CAD packages. The children he taught got As, but if he hadn't retired a few years ago he'd be one of the teachers stuck trying to teach Hello World to 12 years olds -- I'd passed his level of programming when I was 9 or 10.
He also taught geography for a couple of years, I think covering for a long-term sick colleague, and PE (sport) similarly.
Similarly, I remember seeing teachers at my school change subjects. Sometimes it's fine -- a decent chemistry teacher can teach physics, biology and maths pretty easily, especially to children under 15 or so. But the teachers teaching computer science probably aren't the maths teachers, but the general technology / business teachers who have little choice but to struggle with the new subject.
I'm critical of teachers for a lot of things, but not knowing how to teach Towers of Hanoi isn't one of them. Demanding that someone who knows how to teach Towers of Hanoi get paid the same as the social studies or health teacher IS one of them.
I'm familiar with that one! In the last few months I've run out of patience with the public sector scientific organisation I work for, so I'm looking for a developer job elsewhere. I'm aiming for around double the pay... (Although the situation isn't quite the same. I have highly technical, general, transferrable skills, the scientists have highly technical, extremely specialist, less-transferrable skills, so they're "worth" less.)