Book review: The Little Schemer by Daniel Friedman
This is an unusual book. The first thing to know is that it does not contain chapters that are made up of paragraphs. It is a list of problems. The only way to gain anything from this book is to do the problems. Sure you may look at the first few and think you get the idea, and feel like you are doing fine just by reading the problems and solutions and thinking about them. But it won’t be long until you realize that you have no idea what is going on, and worse, you won’t know where you lost the trail.
So don’t be lazy, if you are going to read this book, set up an interpreter, and start coding.
The second thing to know about this book is that it does not attempt to teach you the Scheme programming language. Which is good news, because you don’t really want to be a Scheme programmer. What this book does teach, however, is of interest to every programmer.
This book is about recursion, and recursion is not optional. Many problems are most effectively modeled with graphs and trees, and if you aren’t able to identify and implement the natural recursion that exists, you will write code that obscures the actual problem, and is harder to write, debug, and maintain. So if you are not comfortable with recursion, this book is an immediate need.
Of course, if you are a programmer that reads blogs, you wouldn’t admit to yourself that you are uncomfortable with recursion, so let me say it another way. Working through The Little Schemer will allow you to quickly identify the basic patterns of recursion problems, and to structure your code in the way that will most clearly reveal that pattern.
I encountered recursive thought first in pure mathematics, where very similar thought is required in mathematical induction. Encountering recursion in programming was like meeting an old friend’s identical twin. The similarities were enough to make me feel more familiar than I was. As a result, my recursive solutions always felt ad hoc, and distinct to the particular problem, rather than following a well-established path.
Regardless of your background, if you are a programmer, or hope to someday be a programmer, and you have any hesitation in implementing recursive solutions, you should work through this book.