
At first glance, literacy and computer science may not appear to have much in common. However, students of all ages can benefit from thinking like a programmer as they work to decode text they are reading, or as they structure writing. Consider your struggling readers. Might they be more likely to engage in ELA if literature is linked to a coding activity, or if they are given the opportunity to think of language arts in a novel way? In my experience, the answer is a resounding yes. The following strategies can be used in classrooms of all ages, though recommended grade spans are included.
K-2: Map Plot Points as Steps in a Sequence
Algorithms are similar to story arcs – with both code and narrative containing a particular sequence. Think of a story like a recipe. Each major event leads to the next, and order matters. Flowcharts, storyboards, or sequencing cards to help students map out key plot points as if they were writing instructions for someone else to follow.
- After reading a story, ask students: “If you were programming a robot to understand this story, what steps would you give it?”
- Encourage students to act out the story like an algorithm—“First, the character wakes up. Then, she hears a noise. Next, she investigates…”
- Ask students to program a robot to visit images from a narrative in the correct sequence. Students can create a flowchart to demonstrate this algorithm.
3-5: Write “Choose Your Own Adventure” Stories Using Logic Trees
As students write “Choose Your Own Adventure” stories, they begin to understand how conditional logic works. Students begin to think in if/then statements, just like a computer making decisions based on input. Additionally, this sparks creativity and students have the opportunity to practice grammar, transitions, and structure in a meaningful way.
- Provide sentence stems such as: If the dragon roars, then the knight hides. vs. If the knight draws his sword, then the dragon flies away.
- Branching diagrams or simple flowcharts can help students to plan the logic paths. It’s storytelling and problem-solving rolled into one.
- Students can convert their story into a coding platform such as Scratch.
6-12: Identify Loops and Repeated Motifs
In coding, a loop tells the computer to repeat something multiple times. Stories do this too—through repetition, patterns, and motifs. These literary elements are key to decoding figurative meanings behind text. The ideas of loops to identify repetition can be utilized when analyzing poetry, novels, or plays. As students identify loops in character studies—they can liken this to a computer that keeps running a flawed program until someone changes the code.
- Ask students to identify behavioral loops – a character who keeps making the same mistake or continually sees the same obstacle show up in different ways. Students can identify the behavioral loop, the consequence, and the moment the loop breaks (if applicable). This can lead to discussions regarding theme and author’s craft.
- Students can write “literary loops”. Example prompts could include: Write a short story or poem where a phrase repeats three times, but takes on a new meaning each time; Create a mini-narrative where a symbol occurs repeatedly to parallel a behavioral loop. Ask students to identify how repetition can build tension, reveal character, or deliver humor.
- Engage students in a discussion about the purpose of repetition, loops, and patterns. Ask: Why do authors use loops? How might this be similar or different to loops we find in code?
As students read and write, it is vital that they begin to think like authors – who use literary elements purposefully. When students think like a programmer, they consider how and why code was written in a specific way. In connection with language arts, this cognitive approach helps students to look past reading and writing as a product and encourages them to examine the process, the decisions that authors make to convey meaning to their audiences.
Looking for more ideas to help students think like a computer scientist? Check out the lesson ideas here.