How to Code a Sandcastle – A Book to Introduce Kids to Code

We made our first summertime trip to the bookstore last week, and we picked up some awesome titles that I’ve had my eye on for a few weeks now. We also signed up for the Barnes & Noble Summer Reading Program! If we read eight books (which honestly we have already done since we went in) we get a free book from the store!! The boys just have to fill out this form and bring it back into the store when we are done. Each kids gets their own form and their own free book. It is a great program and we are so excited that Barnes & Noble is supporting summer reading in such a great way!

The book from our shopping trip that I am most excited to tell you about is called How to Code a Sandcastle – written by Josh Funk and illustrated by Sara Palacios. It is a Girls Who Code book, and my 7 yo boy loved it!


Girls Who Code

If you don’t know about Girls Who Code, you should definitely check them out and learn more. It is a great program for young girls who are interested in learning to code. Here are a few quotes from their website about why getting more girls into tech from a young age is important:

Computing is where the jobs are — and where they will be in the future, but fewer than 1 in 5 computer science graduates are women.

In 1995, 37% of computer scientists were women. Today, it’s only 24%. If we do nothing, in ten years the number of women in computing will decrease to just 22%.

Tech jobs are among the fastest growing in the country, yet girls are being left behind. While interest in computer science ebbs over time, the biggest drop off happens between the ages of 13-17 (Which, by the way, is the age where the program offers an amazing summer immersion camp!).

The tech industry needs more women, and programs like Girls Who Code and Girl Develop It (for adult women) are leading the way in helping that to happen.

Introducing ALL Kids to Code

How to Code a Sandcastle is a great place to start introducing kids to code in general and even teaching them some of the specific terminology and techniques used by coders! It is also just a super-cute book!!

The main character, a girl named Pearl, goes to the beach for her last trip of the summer. She is determined to build a proper sandcastle. Her efforts have been thwarted in the past, but on this day she brings a secret weapon – a robot! She then goes through and explains that people can code robots (because they are computers) to do what they want them to do. She explains that coders must break big problems down into smaller problems and give the computer instructions in order to solve those smaller problems.

Then the magic happens.

In a simple and adorable way, Pearl and Pascal (her robot) work through several small problems in order to build the perfect sandcastle! Pearl gives easy-to-understand explanations of complicated ideas like loops, sequences, and if-then-else statements to the readers as she and her robot work. She occasionally encounters issues with her instructions and has to modify them as well, showing that oh-so-important perseverance quality we talked about in this post.


By the end, she and Pascal have built the perfect sandcastle and more! Then the book does a great thing that I have seen more and more in fiction books lately, and incorporates some nonfiction elements (you can read more about why this is important here) at the end of the book.

In the section called, “Pearl and Pascal’s Guide to Coding,” the book offers further explanation of the terms used throughout. It is very helpful for kids and parents to have that reinforcement of the ideas the book presented. It also acts as a reference section for the future and any early coding experiments your kiddo might want to do.

Early Coding Practice

Speaking of early coding experiments, have you tried Osmo yet? It is not a book, and though I typically only suggest books for you, Osmo has some great early coding games that are worth a mention.

Coding Jam is a game that lets kids use code to make some pretty awesome music!

And Coding Awbie is an awesome interactive game where your kiddos can use code to make Awbie move around the screen and complete challenges.

The Coding Awbie game would be a great extension after reading How to Code a Sandcastle because the idea behind it is so similar to the idea Pearl has in the book.

We also love a board game called Robot Turtles. It teaches the same basics of code, and our oldest son started playing it at age 4!

Boys Should Read Diverse Books Too

Also, I know many of you read this blog to get ideas about what to read with your own boys, so I just wanted to include a note about why I chose a Girls Who Code book for my son and why you might think about doing so as well.

First, it is a great book. No mystery there.

Second, I LOVE that so many books are being published with girls and especially (as this one has) girls of color as the main character. Movements like We Need Diverse Books and 1000 Black Girl Books are so inspiring and have been so effective!

Follow them here: and here: for more.

As parents, we all know that kids tend to gravitate towards books with characters who are the most and look the most like them. And ALL kids should be allowed to have that experience, to see themselves reflected in the main character of a book they love.

However, sometimes kids should be exposed to books in which the main character isn’t like them (or at least doesn’t look like them) at all.

Boys (and especially white boys like my own) need to read books with diverse main characters as well. They need to see that boys who look like them are not the only ones who get to tell their stories. They need to see that boys who look like them are not the only ones who can do all the amazing things book characters get to do. And they need to see that all people, regardless of sex or race, have the same kinds of thoughts, feelings, worries, and joys – an experience that books can give them better than just about anything else.

So, if you hear about a great book, but realize that it has a main character your kiddo might not relate to, don’t rule it out right away. You might be missing out on too many great books and too many important lessons if you do.

Like these two!

As always, thanks for reading! If you know of any other awesome coding books, let us know in the comments below or on social media. Or if you have any books or series that absolutely resonated with your kids even though the main character didn’t look like them, we’d love to hear about them!

- a Girls Who Code book -


- a Girls Who Code book - (1)


16 thoughts on “How to Code a Sandcastle – A Book to Introduce Kids to Code

    1. Thank you so much! We LOVED the book, and the fact that you loved the post made MY day :).

  1. Hi! I actually really liked the post. The title threw me off at first but after I started to read it, it actually turned out to be very interesting. I love to learn about new things that help kids!

  2. I love how you stated that we should introduce our kids to different books other than the ones they would normally choose. Such a simple tip that goes a long way. Very true! We love B&N and This is such a different type of blog for me! I have subscribed 🙂

    1. Thank you! It all stems from the books we read every night with our boys, but it tends to take lots of different directions 😊. I hope you will find it all enjoyable!

  3. Love this! Never thought of teaching kids to code at a young age! I gotta get my little one started to he can start doing some back end work for me 🙂

  4. This post is so cool! My oldest would love the games, and I love that you’ve tied them into reading! We’ll look into these titles as well as the games for some summertime fun!

    1. Thank you! We are having a rainy week, so we have been playing them a lot around here :).

Leave a Reply