‘You just crossed over into the Twilight Zone. And it’s a total headfuck.” OK, so Jordan Peele’s Netflix reboot doesn’t actually begin like that – but it could. While most of its first creepy tale, of a comedian (Kumail Nanjiani) who discovers success comes at a price, could have been broadcast in 1958, that era would have struggled with the 15 F-bombs. Meanwhile, on board Star Trek Discovery, currently on Netflix, swearwords are dropped like photon torpedoes. Classic sci-fi has returned, but with a modern potty mouth.

The future didn’t used to be so profane. HG Wells wrote an essay on the “vivid, scorching and variegated” world of cursing, yet the worst word in War of the Worlds is “tripod”. Authors such as Isaac Asimov, Larry Niven and EE Smith invented futuristic expletives such as “Tanj!” (“There Ain’t No Justice”, credited to Niven) to stay decorous. As the Encyclopaedia of Science Fiction entry on swearing makes clear, these could be pretty weak – try shouting “By space!” when you next stub your toe.

The first true test of space-swearing came with real astronauts in the 1960s, broadcast live to the world’s media. Nasa was nervous about their swaggering test pilots – one foul-mouthed spaceman was reportedly hypnotised into humming instead, but the odd gaffe made it to the mission transcripts. Pete Conrad, the third man on the Moon, predicted he would take “the first shit on the lunar surface”. John Young and Charlie Duke moaned about their potassium-rich diet like they were standing at the urinal, not skipping across a heavenly body, with Young complaining to Duke: “I haven’t eaten this much citrus fruit in 20 years, and I’ll tell you one thing, in another 12 fucking days I ain’t never eating any more.” (Young had previously smuggled a corned beef sandwich into space.)

Nevertheless, when they remembered the microphone was on, these were professionals. The public image of astronauts as orbiting boy scouts influenced the sci-fi of the era, such as in Star Trek’s imagined future of “evolved” humans who had overcome our base instincts.

Facebook Twitter Pinterest ‘Shazbot!’ ... Mork and Mindy. Photograph: Alan Houghton/Rex/Shutterstock

Similarly, if you discovered aliens planned to eat you, you might be reasonably expected to swear – but The Twilight Zone was written by luminaries of pulp sci-fi magazines, who were used to shocking readers without using shocking language. Sci-fi lives in abstraction and allegory, and this approach allowed them to deliver criticisms of racism and prejudice into US households. The screenwriter Rod Serling used to say: “A Martian can say things that a Republican or Democrat can’t.”

Great breakthroughs in swearing came while trying to sneak past the censors on network TV. Mork & Mindy made “Shazbot!” a favourite among baby boomers. The smegheads on Red Dwarf smegged all the smegging time, and it had nothing to do with a fridge. “Frakk” was coined by Glen A Larson for Battlestar Galactica in the 1970s, but the 2004 reboot changed the spelling to “frak”: a literal four-letter word that has gone on to be used everywhere from 30 Rock to politics. But when sci-fi crossed over to film with blockbusters, profanity was key to dispelling its childish image – and making a crazy premise relatable.

Facebook Twitter Pinterest Frakk this! ... Battlestar Galactica. Photograph: Everett Collection Inc/Alamy

The Terminator was a futuristic robot, but he stalked the streets of 1980s Los Angeles, indicated by often foul-mouthed slang. The crew of the Nostromo in Alien were not astronauts, they were blue-collar “space truckers”. The point of the swearing was to bring sci-fi down to Earth.

Which is why it is a shame that our terrestrial cuss words have caught on in outer space. It’s not that we won’t swear in the future, but it is familiar – and sci-fi, as Peele says at the beginning of The Twilight Zone, is about a “dimension of imagination”. Language is the first sign we have arrived in a foreign land, and swearing is a way of discovering new civilisations and what they find offensive. Why would alien cultures balk at words connected with sex and scatology? After all, the most offensive word in the galaxy, according to the Hitchhiker’s Guide, is “Belgium”.

Star Trek Discovery is available on Netflix; The Twilight Zone is expected to air in the UK this year