STEAM Education / Interdisciplinary Learning (Innovation & Future Learning)
Coding Characters: Using Computational Thinking to Analyze Literary Themes
LOGO

Why My ELA Classroom Is Starting to Sound Like a Coding Bootcamp
"What do your favorite book characters and your favorite apps have in common? Algorithms."
That's how I started class last Monday. I was met with confused looks, a few chuckles, and one brave student who asked, "Wait... does that mean Katniss could code?"
In a classroom where many of my students are more comfortable with TikTok than textbooks, I'm always looking for new ways to engage them. Our school is part of a diverse, low-income district where standardized test scores are often used as a marker of success. But anyone who knows our kids knows that their brilliance doesn't always show up in NWEA scores.
That's why I've started bridging the gap between literature and computer science.
It turns out that the same skills my students use to analyze a character's choices or predict what might happen next in a novel are also part of what coders call computational thinking. When we talk about inference, we're really debugging — spotting the clues, making sense of patterns, and reaching a logical conclusion. When we break down a story into its parts — exposition, rising action, climax — that's decomposition, a key part of writing code. And identifying a novel's theme? That's abstraction at work: pulling out the big idea from the details.
I'm not saying every 8th grader in my room is about to launch the next Google. But I am saying that when we treat computer science as just another way to make sense of the world — and our stories — more students see themselves as capable of doing both. We read. We write. We code. We analyze.
And we're not just raising readers — we're raising problem-solvers.
This is what it looks like when we teach English Language Arts with future-ready thinking in mind. And it all starts with a simple idea:
What Is Computational Thinking? A New Way to Read, Write, and Solve Problems
Let's face it — teaching 8th grade ELA means helping students see the real-world value in everything we do. Whether we're diving into a short story, writing a persuasive essay, or analyzing a poem, I often hear: "But when am I ever going to use this in real life?"
Great question. And here's my new favorite answer: Computational Thinking.
Simply put, computational thinking is a way of breaking down problems and solving them — kind of like how a computer does, but using our amazing human brains. It includes four main skills:
Decomposition — Breaking a big problem into smaller parts.
Pattern Recognition — Looking for similarities, trends, or repeated elements.
Abstraction — Focusing only on what's important, ignoring the rest.
Algorithmic Thinking — Creating step-by-step solutions or rules to solve problems.
These aren't just skills for computer scientists. They're skills for everyone — including middle schoolers writing essays or interpreting a character's motivations.
Let's take literary analysis. When we read a complex text, we're actually practicing computational thinking all the time:
Decomposition: When we break down a novel into plot, character, setting, theme — yep, that's decomposition.
Pattern Recognition: Spotting recurring symbols, tone shifts, or character behaviors? That's pattern recognition.
Abstraction: We zoom out to summarize the big idea or theme of a story — abstraction in action.
Algorithmic Thinking: Creating a thesis statement and supporting it with evidence in a clear structure? You've just written an algorithm for your essay.
Computational thinking is already hiding inside ELA. We just haven't been calling it that.
As an ELA teacher, my job isn't just to teach reading and writing — it's to help students become thoughtful, strategic thinkers. Computational thinking is a bridge between the literary world and the real one. It's a toolbox for decoding not just Shakespeare, but life.
Characters as Algorithms: Teaching Students to "Code" Literature
Now let's take that a step further and get really nerdy (in the best way): what if we taught students to think of characters as algorithms?
Sounds wild, but stay with me. Our goal? Get students thinking logically, critically, and creatively about character behavior — using the CT skills they already use, without even knowing it.
When students read a novel, they're constantly asking questions like: Why did she do that? What will he do next? How can I prove this character is brave, selfish, or kind? Turns out, we can break that thinking into four steps using computational thinking.
1. Decomposition
Break down the character's actions into smaller decisions or events.
Example (The Giver): Jonas receives memories → Starts questioning rules → Sees the truth about "Release" → Plans to escape.
2. Pattern Recognition
Spot repeated behaviors, feelings, or motivations.
Jonas Pattern: When faced with injustice → Feels discomfort → Seeks truth → Takes action.
Let students track patterns in dialogue, internal thoughts, or choices — this helps them go beyond surface-level observations.
3. Abstraction
Ignore the noise. What are the core traits that drive this character?
For Jonas: forget the minor details. At his core, Jonas is curious, empathetic, and courageous.
We teach students to filter out irrelevant info (what he eats, wears, etc.) to focus on what truly defines him.
4. Algorithmic Thinking
Now the fun part: predict what a character will do next by creating an if/then flowchart.
Let students code their own character flowcharts on paper, slides, or even using simple block coding tools like Scratch or diagrams in Google Drawings!
Why This Works
Using computational thinking to "code" a character:
Deepens literary analysis by making students justify character claims with evidence.
Encourages prediction, not just comprehension.
Builds logical reasoning skills in a creative, engaging way.
Makes writing essays and defending claims feel more like solving a puzzle.
Try It With Percy Jackson
Character: Percy Jackson (from The Lightning Thief)
Decomposition: Learns he's a demigod → Goes on a quest → Faces challenges → Protects friends.
Pattern Recognition: Impulsive, loyal, sarcastic, brave in danger.
Abstraction: Core traits = Loyal + Brave + Feels like an outsider.
Boom. Now students are thinking like coders and literary critics.
Try It Yourself: The Character Algorithm Activity
Ready to bring this into your own classroom? Here's the simplest version to try this week.
Give students a character from your current class novel — or let them pick their favorite. Walk them through the same four steps we used with Jonas and Percy Jackson:
Decompose the character's key decisions into a short timeline.
Spot the pattern — what do they do every time they face a certain kind of moment?
Abstract it down to two or three core traits.
Write the algorithm — an IF/THEN chain that predicts what the character would do in a brand-new situation you invent.
Students can build this on paper, in a flowchart tool like Google Drawings, or — if you want to go further — as an actual block-coding project in Scratch, where the "algorithm" becomes a real, clickable program.
This maps naturally onto standards like RL.5.3, RL.6.1, and RL.7.3 (analyzing how characters respond to challenges and citing evidence for it) — so it's not an add-on, it's the same skill, dressed differently.
Final Thought
Teaching characters as algorithms isn't about turning novels into math problems. It's about giving students new tools to understand people — on the page and in real life.
And when students realize that analyzing Percy Jackson or Jonas is kind of like writing a program? Suddenly, ELA feels a little more epic.
Twisted Takeaway ✨
Pick one character your students are reading right now.
Could they run that character through all four steps — decomposition, pattern recognition, abstraction, algorithmic thinking — using only evidence from the text?
What would change in your classroom if "prove it" became a coding challenge instead of a comprehension question?
📥 Free Resource: The Character Algorithm Template
Grab the free, ready-to-use template that walks students through decomposition, pattern recognition, abstraction, and algorithmic thinking for any character in any book — the exact activity from this article, built to hand straight to your class.
Download the template — Free →
Ready to go further? The Coding Characters Toolkit and the full Computational Thinking Unit build this single activity into a complete, standards-aligned learning arc.