As school librarians our heart leads us to books. Using picture books is a great way to teach beginning coding concepts. Digital Citizenship week and Hour of Code celebrations are often featured in many of our school libraries.
I like to prepare students for Hour of Code by reading books that illustrate coding concepts in the weeks prior to December. There are several concepts that are used in programming and coding. Below are three basic coding concepts: sequencing, stacks and queues, and conditionals.
Sequencing
Sequencing is the step-by-step order in which instructions are given. We also refer to this as an algorithm. Sequencing is a fairly basic concept we teach through picture books. Think of this as beginning, middle, end, or first, next, last. Any picture book that tells the story in a specific order can work to teach sequencing. For Hour of Code 2017, we used The Very Hungry Caterpillar by Eric Carle.
I began by placing images of the fruit the caterpillar ate onto our carpet space. As I read the book aloud, students coded me through the story. Students love the unplugged activities and are able to pull their unplugged experiences into coding activities.
Think of any book you would use to teach order of events. For ideas, check out this Padlet for Coding and Early Literacy!
Stacks & Queues
A stack is how information is packaged together. Think of this as books that read as if actions are being added onto one another. A great book for this is The Little Old Lady Who Swallowed a Fly. There are several versions of this classic story. In this particular story, the actions are being added as the little old lady swallows one thing after the other.
A queue is information waiting to be told what to do. The Long, Long Line by Tomoko Omura and Waiting by Kevin Henkes are both great picture books for queues. Each story features animals that are waiting in a line for an event to take place, much like a coding queue.
Conditionals
Conditionals may be one of my favorite coding concepts to teach through picture books. Conditionals are events that cannot happen until something else is done. Music on my Pandora playlist won’t play until I push the “play” button. If I push the button, music will play.
If You Give a Mouse books are some of the best books to use for teaching the coding concept of conditionals. This series of books written by Laura Numeroff are popular to use when teaching cause and effect. Essentially, conditionals is cause and effect.
Another way to approach teaching conditionals through picture books is to approach it in the reverse. This happened because of this. In Alexander and the Terrible, Horrible, No Good, Very Bad Day by Judith Viorst, Alexander’s bad day all stemmed from one event. His bad day happened because he woke up with gum in his hair.
Other Resources
Many websites and apps are available to help teachers and school librarians incorporate coding concepts into their lessons. CodeSpark Academy is a free resource specifically designed for students second grade and under. I have found that older students often enjoy the coding games available through the CodeSpark app, as well.
Code.org has several great resources including lesson plans, courses, Hour of Code activities, and coding spaces.
CS First with Google features sample activities for Hour of Code and more in depth courses for teaching computer science. Resources are available for teachers. The training videos are a perfect way to get started with coding.

Author: Ashley Cooksey
Library Media Specialist in Arkansas. Self-proclaimed geek. Lover of nature and music. Always learning.
Categories: Blog Topics, Technology
I like the way you think, Ashley!
Here’s a coding lesson idea inspired by the picture book “How to Code a Sandcastle” by Josh Funk.
https://librarylessonswithbooks.com/2018/07/30/how-to-code-a-sandcastle-by-josh-funk/
The book does a really nice job of applying code to an unplugged activity.
I am attempting to claw back library time for Junior school – it was recently taken away so that I could teach ‘other’ classes ;-( . By any chance would you be willing to share some scope and sequence or other lesson plans that I could use to strengthen my case for Junior library?
I am currently converting what you have posted so far into something I can present to them.
Maureen Schlosser, yours was also very useful, thank you for sharing.