This article on erroneous code in fiction is part of the Science in Sci-fi, Fact in Fantasy blog series. Each week, we tackle one of the scientific or technological concepts pervasive in sci-fi (space travel, genetic engineering, artificial intelligence, etc.) with input from an expert.
Please join the mailing list to be notified every time new content is posted.
About the Expert
K.J. Harrowick is a freelance web developer with fifteen years of experience building digital content for large corporations and small, independent startups across North America, Europe, Australia and Japan. As a child, she fell in love with exotic alien worlds, which continued well into adulthood where she began to craft alternate worlds and fantasy languages. A science fiction and fantasy writer, and creator of Winterviews, K. J. resides in the rainy Pacific Northwest where she works with a broad range of client projects, plots how to destroy her characters’ lives, and occasionally falls down rabbit holes. You should follow her on Twitter, Facebook, or Goodreads.
Erroneous Code in Fiction
The goal is not to get it perfect necessarily. You get it as right as you possibly can while still telling a good, compelling story.”
-Kevin Grazier
Kevin’s words strike an important nerve in regards to storytelling, whether in television, movies, or a well-loved book. When it comes to code in fiction, the first thing to cross your mind is probably the ever-magical computer code hackers use to bring down an evil corporation and save the day.
Except it isn’t quite so simple.
Digital language has been around a long time, from French telegraph engineer Émile Baudot, who invented the Baudot code, to more than two hundred programming languages around the world. And yet if there’s one consistent thing I always see in science fiction, it’s the all-in-one magical hacker who can transcend language with a little punk rock and a long night of script writing.
To understand why the hacker vs. corporation security myth doesn’t work, we need to dig deeper, straight to the source: the code.
And what better way to go straight to the source than to look at the 1999 blockbuster film, The Matrix.
In one scene, Cypher sits in front of a computer screen while he watches the falling rain Matrix code and says “there’s way too much information to decode the Matrix. You get used to it, though. Your brain does the translating. I don’t even see the code. All I see is blonde, brunette, redhead.” This is a contradiction because he says there’s too much to decode, then immediately flips the statement on its head.
With modern applications and computer software, multiple programming, markup, and scripting languages work together as a cohesive unit. This is also where The Matrix misled their viewers with the idea that anyone can glimpse a few lines of code on a single screen and view the application in motion.
But the falling rain Matrix code is awesome, right? In reality, the Simon Whiteley creation is a compilation of sushi recipes from his wife’s cookbook. And this isn’t the only faux pas we see in modern film with regards to code.
In the 1984 classic, The Terminator, there’s a memorable scene where viewers get to see the world through the T-800’s heads-up display. Back then the code printout on the side looked pretty cool, except it’s assembly code for the old Apple-II machines. It kind of makes you wonder what this says about Skynet.
By 2013, you’d think storywriters would be a bit more knowledgeable, but that isn’t the case for the movie Elysium. As the space station is rebooted, the glass screens flash lines of code that look fancy, but they’re taken directly from the Intel software developer’s manual, according to programmer John Graham-Cumming.
Modern fiction writers have ways of suspending disbelief which can keep readers and moviegoers riveted to the story. Yet, as generations of children grow up with easy access to digital language, the challenge becomes how to leverage accurate code and technology into a believable and compelling package. When so many elements in past stories are overlooked in favor of the all-in-one hacker, loud banging on keyboards with only two minutes to save the world, and inaccurate code used to paint an inauthentic scene, we have to go back to Kevin Grazier’s statement. How do we get this element of fiction as right as we can?
Realistic Code in Fiction
Ironically, the 1999 movie Office Space, may hold the answer for how to incorporate code effectively in our fiction. While the movie is not without its faults (i.e. Peter Gibbons’ computer shutdown scene), viewers get a rare glimpse into the truth about life as a computer programmer.
What Happens in the Office, Stays in the Office
Most companies require your signature on a non-disclosure agreement before you start work. Because when you write code, you’re accessing information which is usually exclusive to that company or military branch.
Smells like Team Spirit
Modern developers work in teams. Whether it’s code for grocery store checkout lanes, the F-22 jet, a hospital heart-rate monitor, a power toothbrush, or a digital website, code-based applications require a team of specialists to bring them online. Even small projects like a digital newsletter require a designer, copywriter, developer, and quality assurance tester.
Smothered in Bugs
A ticking clock can add a fantastic layer of tension to any conflict. When it comes to code, there is never a perfect solution. Bugs (errors) pop up all the time. Some are easy to spot and fix, but others require developers to dig into long sequences of letters and numbers, talk to other specialists, conduct research, and cross their fingers when the code recompiles in the hopes their fixes work. Because there’s the old adage every developer knows: fix one bug and create three more.
It’s All in the Language
When we’re children, it takes several years with a limited vocabulary to grasp the basic flow and syntax of our primary language. For those who started their second language in high school, there’s again the struggle to grasp and construct key components together in our heads so we can speak fluently. Code is a language and works much the same way: it takes years of work and dedication to become an expert. Unlike Neo, we can’t download the information straight to our brains.
So, if you’re writing a science fiction story, whether it’s a novel, screenplay, or any fiction tale in a technologically advanced world, it’s good to remember that technology always has a very basic starting point.
Modern technology doesn’t run on a single language, nor does it run on only one type of machine. With the help of scripts, different types of code speak to one another and translate data from machine, assembly, and object languages. Citizens across the world use phones, tablets, watches, and desktop computers as part of everyday life. Yet often overlooked are the computers and applications used in cars, airplanes and military vehicles.
Differences in culture and language can influence the path from those first digital Baudot signals to a fleet of starships around a planet using coordinated attacks.
The hacker trope these days is an element which readers can no longer suspend disbelief for. As our world becomes more technologically advanced, writers need to consider how code runs on machines and how many specialists might be needed to navigate the language in a culturally diverse fantasy universe. They should also understand the uses of technology through the eyes of the culture they’ve created and how it impacts the characters’ lives. How do all of these elements influence each character’s thoughts, actions and decisions?
For those writing lines of code for your book to give your world a more authentic feel, if you aren’t sure where to start, talk to an expert. Don’t rip lines or sequences out of a manual, because this will reflect back on you and add a layer of disbelief to your story. Instead, ask a developer about the work. Hire one to write a few lines of code or a small script, especially if you’re creating the story for film or television. Find ways to pull the authenticity into your narrative world, because the more you get the technology right, the more your readers can put their faith in other elements and enjoy the beautiful work of art you’ve created.
Follow me and you'll never miss a post:












Please share this article:












Thank you, Dan!
Thank you K.J., this is just what I need – right now – for my NaNoWriMo project! And, I’m excited to have found your website and the PTSIF book, thanks to Chuck Wendig 😀
You’re so welcome, Leslee! If you have further questions I didn’t answer in the article, don’t hesitate to reach out. 🙂
Thank you! Thank you! A plot problem has just been solved. My MC, a sentient android, has to rewrite some of her code. It was nagging me how to present it so the team of programmers wouldn’t notice it. You provided the solution! Multiple teams and multiple languages and scripts.
If discovered, people will think it’s another team’s code, and ignore it! Human nature and job focus rules the day!