‘The CS Detective’ Teaches Computer Science Through Fiction

Books Education
Image: No Starch Press

I was introduced to higher level Computer Science concepts in high school. I think I took at least one computer-related class each year, sometimes more. We were taught in a pretty straightforward, logical way, from simple concepts up toward more complicated ones. But these days, Computer Science concepts are often taught from such an early age that they aren’t taught sequentially, or even in order of complexity. There are books, toys, kits, apps, and games that all introduce kids to programming and Computer Science. This seems to be the new way of things. So, let’s work with what we’ve got. (See GeekMom Ariane’s fantastic Computer Science Education Week round-up post from December for other Computer Science ideas for kids.)

Author Jeremy Kubica has written a number of fictional books that lay the foundation for more in-depth computer science concepts than the things aimed at younger kids. Computational Fairy Tales came in 2012, Best Practices of Spell Design in 2013, and 2016 brought us The CS Detective.

The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and Computation is a detective story that teaches how search algorithms work. Within the book…

…readers meet Frank Runtime, disgraced ex-detective turned private eye and search expert. When Frank’s former police chief suspects a traitor in the ranks, he turns to Frank to crack the case. Luckily, Frank has no shortage of algorithms at his disposal to get the job done.

As you read the tale, you will learn about search algorithms such as best-first and breadth-first search, iterative deepening, exhaustive search, parallelizing, and more, as well as one of my favorite things ever, the binary search tree. There is plenty in this book for even us Computer Science majors of the ’90s to learn. The book isn’t a comprehensive lesson or curriculum, but is a great introduction for older kids or adults to the concepts contained therein.

The story is filled with humor, adventure, and references to previous books. As concepts unfold in the story, the book also includes lessons that Frank learned back in his Police Algorithms 101 class at the Academy. There are also plenty of illustrations and diagrams that illustrate the problems at hand. This is really important, because many people learn much better when they know why they are learning something new. When they have concrete problems to solve using these search algorithms as tools, it all has meaning and purpose, which makes learning about search algorithms in the context of a story a perfect fit.

Frank Runtime spends the whole book solving the mystery, taking us along for the ride on this enjoyable adventure, but fortunately for us, Kubica leaves room at the end of the story for a sequel. I, for one, hope he continues to write these books that teach Computer Science concepts through storytelling. They’re fun, educational, and a fantastic introduction to the concepts they address. Learning through stories also helps retention.

The CS Detective is available wherever you buy books. I highly recommend all of Jeremy Kubica’s books for older kids and adults who are interested in Computer Science. They are also fantastic for younger kids, if a parent reads along with them, helping to explain anything they don’t understand. If you’re still not sure, check out the first chapter, for free! GeekDad Will shared a sneak preview of the book last summer.

Author Jeremy Kubica is a principal engineer at Google, and spends his days working with the content he includes in his books.

Note: A copy of the book was supplied for review purposes.

Liked it? Take a second to support GeekDad and GeekMom on Patreon!
Become a patron at Patreon!