How to Code a Sandcastle
By Jan Carr,
Common Sense Media Reviewer
Common Sense Media Reviewers
Solid coding lessons fill fun tale of girl and her robot.

A Lot or a Little?
What you will—and won't—find in this book.
Where to Read
Community Reviews
There aren't any parent reviews yet. Be the first to review this title.
What's the Story?
In HOW TO CODE A SANDCASTLE, it's the last day of summer vacation, and Pearl's sandcastles keep getting destroyed -- by waves, by Frisbees, by dogs. So she decides to enlist the help of her robot friend, Pascal. "He’ll do whatever I tell him -- as long as I tell him in CODE. It’s not secret code -- it’s special instructions that computers understand." Pearl sequences the task, breaking the big problem into smaller ones, some of which she instructs him to repeat in a loop. Pascal doesn't always understand the instructions; when she sends him out to get decorations, he comes back with a baby's binky. So she creates if-then-else code that specifies the steps more clearly. At the end, they create a moat to protect the sandcastle, and use a loop code to create a whole kingdom.
Is It Any Good?
This sunny book delivers lots of fun along with its serious computer lesson: Coding's a day at the beach if you use it to build a sandcastle. How to Code a Sandcastle successfully introduces basic concepts by using coding language to demonstrate how to break a simple task into its component parts, which is a good life skill as well as a computer skill. Author Josh Funk includes plenty of humor. The main character's not daunted when a "flying saucer" (Frisbee) knocks over her castle, or when it gets an unintended moat (via dog pee). But the lessons aren't just breezy, they're solid, and the pages at the end explain the coding concepts of sequence, loop, and if-then-else more fully.
Illustrator Sara Palacios makes sure the crowd at this beach is racially diverse, with lots of African American beachgoers, and families that are racially mixed. Pearl, the narrator, is way cute in her heart sunglasses and springy pigtails, and Palacios cleverly works in illustrations of people absorbed in beach reading, with one newspaper sporting a propos headlines -- "Programmer fixes bug!" and "Memory leak disaster!" -- and a magazine with a photo of an African American subject. The lesson goes down as easily as a refreshing ice pop on a hot beach day, and it's just as welcome.
Talk to Your Kids About ...
Families can talk about the coding concepts in How to Code a Sandcastle. Do you understand sequence, loop, and if-then-else? Did the story make them clear? Did the explanation at the end help you understand?
Are there other times in life when you've had to break down a big task into a little one either to understand it or to accomplish it? How did you do that? Are there tasks you do over and over that it would be helpful to "loop?"
If you had a robot, what other fun tasks would you break down using these coding concepts? Try making your own story and instructions.
Book Details
- Author: Josh Funk
- Illustrator: Sara Palacios
- Genre: Picture Book
- Topics: STEM, Great Girl Role Models, Robots, Science and Nature
- Book type: Fiction
- Publisher: Viking Books for Young Readers
- Publication date: May 15, 2018
- Publisher's recommended age(s): 4 - 8
- Number of pages: 44
- Available on: Nook, Hardback, iBooks, Kindle
- Last updated: April 29, 2018
Did we miss something on diversity?
Research shows a connection between kids' healthy self-esteem and positive portrayals in media. That's why we've added a new "Diverse Representations" section to our reviews that will be rolling out on an ongoing basis. You can help us help kids by suggesting a diversity update.
Suggest an Update
Where to Read
Our Editors Recommend
Books for Kids Who Love Math and Science
Cool Coding Apps and Websites for Kids
Common Sense Media's unbiased ratings are created by expert reviewers and aren't influenced by the product's creators or by any of our funders, affiliates, or partners.
See how we rate