The robots are coming. Hide the WD-40. Lock up your nine-volt batteries. Build a booby trap out of giant magnets; dig a moat as deep as a grave. “Ever since a study by the University of Oxford predicted that 47 percent of U.S. jobs are at risk of being replaced by robots and artificial intelligence over the next fifteen to twenty years, I haven’t been able to stop thinking about the future of work,” Andrés Oppenheimer writes, in “The Robots Are Coming: The Future of Jobs in the Age of Automation” (Vintage). No one is safe. Chapter 4: “They’re Coming for Bankers!” Chapter 5: “They’re Coming for Lawyers!” They’re attacking hospitals: “They’re Coming for Doctors!” They’re headed to Hollywood: “They’re Coming for Entertainers!” I gather they have not yet come for the manufacturers of exclamation points.

The old robots were blue-collar workers, burly and clunky, the machines that rusted the Rust Belt. But, according to the economist Richard Baldwin, in “The Globotics Upheaval: Globalization, Robotics, and the Future of Work” (Oxford), the new ones are “white-collar robots,” knowledge workers and quinoa-and-oat-milk globalists, the machines that will bankrupt Brooklyn. Mainly, they’re algorithms. Except when they’re immigrants. Baldwin calls that kind “remote intelligence,” or R.I.: they’re not exactly robots but, somehow, they fall into the same category. They’re people from other countries who can steal your job without ever really crossing the border: they just hop over, by way of the Internet and apps like Upwork, undocumented, invisible, ethereal. Between artificial intelligence and remote intelligence, Baldwin warns, “this international talent tidal wave is coming straight for the good, stable jobs that have been the foundation of middle-class prosperity in the US and Europe, and other high-wage economies.” Change your Wi-Fi password. Clear your browser history. Ask H.R. about early retirement. The globots are coming.

How can you know if you’re about to get replaced by an invading algorithm or an augmented immigrant? “If your job can be easily explained, it can be automated,” Anders Sandberg, of Oxford’s Future of Humanity Institute, tells Oppenheimer. “If it can’t, it won’t.” (Rotten luck for people whose job description is “Predict the future.”) Baldwin offers three-part advice: (1) avoid competing with A.I. and R.I.; (2) build skills in things that only humans can do, in person; and (3) “realize that humanity is an edge not a handicap.” What all this means is hard to say, especially if you’ve never before considered being human to be a handicap. As for the future of humanity, Oppenheimer offers another cockamamie rule of three: “Society will be divided into three general groups. The first will be members of the elites, who will be able to adapt to the ever-changing technological landscape and who will earn the most money, followed by a second group made up primarily of those who provide personalized services to the elite, including personal trainers, Zumba class instructors, meditation gurus, piano teachers, and personal chefs, and finally a third group of those who will be mostly unemployed and may be receiving a universal basic income as compensation for being the victims of technological unemployment.”

Readers of Douglas Adams will recognize this sort of hooey from “The Hitchhiker’s Guide to the Galaxy.” Long ago, in a galaxy not at all far away, the people of the planet Golgafrincham were divided into three groups: A, “all the brilliant leaders, the scientists, the great artists, you know, all the achievers”; B, “hairdressers, tired TV producers, insurance salesmen, personnel officers, security guards, public relations executives, management consultants” (the group that everyone else considers to be “a bunch of useless idiots”); and, C, “all the people who did the actual work, who made things and did things.” The B people, told they must lead an expedition to colonize another planet, rocket away in a starship, having been led to believe that their planet is doomed. “Apparently it was going to crash into the sun or something,” the B ship’s captain tells Arthur Dent, vaguely wondering why the other ships never followed. “Or maybe it was that the moon was going to crash into us. Something of the kind. Absolutely terrifying prospect whatever it was.” Dent inquires, “And they made sure they sent you lot off first, did they?”

This time, notwithstanding Elon Musk’s ambition to colonize Mars, no one’s trying to persuade the B people to board a spaceship, because the B people—the hairdressers and the Zumba-class instructors, the meditation gurus and the personal trainers—are supposed to stick around to cater to the A people. No, this time it’s the C people, the people who make and do things—things that can now be made and done faster and cheaper by robots—who are being flushed down the cosmic toilet. The historian and sometime futurist Yuval Noah Harari has a name for the C people: he calls them the “useless class.” Some futurists suggest that, in our Asimov-y future, these sort of people might wind up spending their empty days playing video games. Otherwise, they’ll wage a revolution, an eventuality that the self-proclaimed “cognitive elite”—the A people, who believe themselves to be cleverer than the cleverest robots—intend to wait out in fortified lairs. (Peter Thiel owns nearly five hundred acres of land in New Zealand, complete with its own water supply.) More popular is the proposal to pay the C people for doing nothing, in order to avert the revolution. “It’s going to be necessary,” Musk said during a summit in Dubai two years ago, joining a small herd of other billionaires, including Mark Zuckerberg, of Facebook, and Stewart Butterfield, of Slack, who endorse universal basic income. It’s either that or build a wall.

Fear of a robot invasion is the obverse of fear of an immigrant invasion, a partisan coin: heads, you’re worried about robots; tails, you’re worried about immigrants. There’s just the one coin. Both fears have to do with jobs, whose loss produces suffering, want, and despair, and whose future scarcity represents a terrifying prospect. Misery likes a scapegoat: heads, blame machines; tails, foreigners. But is the present alarm warranted? Panic is not evidence of danger; it’s evidence of panic. Stoking fear of invading robots and of invading immigrants has been going on for a long time, and the predictions of disaster have, generally, been bananas. Oh, but this time it’s different, the robotomizers insist.

This thesis has been rolling around like a marble in the bowl of a lot of people’s brains for a while now, and many of those marbles were handed out by Martin Ford, in his 2015 book, “Rise of the Robots: Technology and the Threat of a Jobless Future.” In the book, and in an essay in “Confronting Dystopia: The New Technological Revolution and the Future of Work” (Cornell), Ford acknowledges that all other earlier robot-invasion panics were unfounded. In the nineteenth century, people who worked on farms lost their jobs when agricultural processes were mechanized, but they eventually earned more money working in factories. In the twentieth century, automation of industrial production led to warnings about “unprecedented economic and social disorder.” Instead, displaced factory workers moved into service jobs. Machines eliminate jobs; rising productivity creates new jobs.