The Lisp Alien arrived: a “Land of Lisp” review/opinion
I finished reading Land of Lisp (LoL) from cover to cover some days ago. I bought the print+pdf pack the day it was released, because I simply couldn’t resist. The video and the comic available on the website convinced me that, even if it was the worst book in the world (which it obviously isn’t), I needed to have it. I read the first three chapters of the pdf just to check it and then I decided to wait for the real thing. Surprisingly, it arrived sooner than expected. I started again from the beginning and only stopped at the very end. So, how was the book? The short version: very good. The long version: well, keep reading this post :-)
Land of Lisp became one of my favorite Lisp, and programming, books. The main reason is how different the book is. The cartoons and the jokes are a major part of that but what really makes the book great, is how Conrad Barski connects the fun side to the actual content. And in this aspect, teaching and presenting Lisp through simple games is a key to that link. The pieces just fall into place. And the selection of games, characters, etc, is for the most part well done making you feel that you are in a conversation with the Wizard himself. That’s perhaps the best description of what it feels like reading the book: you’re the apprentice that is next to the Wizard and he just shows you, step by step, all those wonderful spells in a very convincing way.
What about the content itself? How is the book and how does it relate to other Lisp books, specifically the ones aiming for beginners? What does it present? Well, I think a lot can be said about all that. In my opinion, the introduction is one of the best chapters in the book. The history section is one of the most original texts I’ve read in a computer-related book. The first steps with Lisp are also well accomplished since I think it will be very easy for a beginner to surpass all those initial non-issues (which Lisp? what implementation, etc.) and at the same time understand why things are the way they are. Although I don’t use CLisp, I don’t think it was a bad decision to use it as the implementation for the book. It’s more than fine for learning and allows the book to explore certain areas that otherwise would not be possible in an agnostic manner (e.g., sockets). Unless libraries were used, but I don’t think that would be good in an entry-level book like this.
The approach to teach Lisp in LoL is mostly a functional one. From the first chapters the concepts are presented with the functional style always in mind. To be honest, I don’t think this is a bad approach but it has some drawbacks. It’s easy to show a lot of things and explain others but fails in showing how Common Lisp really excels. Chapter 5, building a text-based game, is a good example of how a functional style works well. However, this does not mean the more imperative, non-functional aspects, are “hidden” or held-back. It’s quite the opposite. The initial chapters, and specifically chapter 2, show how to declare variables and assign values. It also shows a lot of “with effects” stuff. The genius of the author is precisely in how he puts all these concepts together. In the end, the user feels the advantages of the functional aspects and at the same time sees lots of familiar stuff.
Along the way we find some gems. One is chapter 6.5, about lambda. Another is the “Periodic Table of the Loop Macro” in pages 200 and 201. This is the most innovate way I’ve seen to clearly present loop. I wish a poster would be made out of those two pages. I never liked Chemistry so much but I love this periodic table. The very last gem is surely the last cartoon explaining the main Lisp features (this cartoon is available at the website). Conrad Barski is able to present the main topics of Common Lisp. On top of that, he leaves the comfort zone and shows how to use Lisp for “real stuff”, more practical, even in the form of a game. You get to see how to produce graphviz files, how to do web development, play with SVG files among other things. I also liked very much how macros are used to introduce Lazy evaluation and how a faster version of the Dice of Doom game is developed.
However, just because LoL is now one of my favorite Lisp books, it does not imply that I think it is the best. And the reason is very simple: it does not show well the multiparadigm language Common Lisp is. It feels that the second part of the book is missing. And that becomes more clear when you finish the book and read the last comic. For instance, where is CLOS? Why was the condition system left “in half”? The book is strong in presenting things from a functional point of view but fails for the others, mainly in how mixing paradigms is better than going for just one. It’s not easy to write a book and choices must be made but a beginner will finish the book with the view that Common Lisp is more functional programming and, in my opinion, that can be misleading. The real power of Common Lisp is that it is the only language that accomplishes better multiparadigm programming. The Lisp way is adapting to the problem at hand and not the other way around (like most languages do). Still, this does not make the book any less good. But a second part would be nice, like “The Lisp Aliens Strike Back” or something along those lines :-)
This is definitely a beginners book, a first book for someone who wants to learn Common Lisp and knows already how to program. But, which kind of beginner? This is an important point. Different persons with different backgrounds will surely react and learn in their own way. I remember the beginning of “Successful Lisp” defining several types of beginners. For me, and taken into account my experience in teaching a subset of CL to undergraduates in an Artificial Intelligence course, this book benefits more young programmers with a curious mind (in terms of how to learn the language). The game-learning model fits very well and the style of the book will keep people interested until the end. If you booked a trip to the moon and you can only carry two books, Land of Lisp and Seibel’s excellent “Practical Common Lisp” (PCL) are the ones you should take to learn CL. After LoL, PCL is the perfect follow-up. Why not the other way around, since PCL is much more comprehensive, complete and focused on how to use CL for practical stuff, etc? Because I still believe PCL is the right book for someone who already knows/has some/little experience in CL or, is a mature programmer (by mature I mean someone who didn’t start programming just a few months ago, regardless of age). Or, in Seibel’s own words,If you’re a hard-nosed pragmatist who wants to know what advantages Common Lisp has. I admit, my opinion is biased because of my experience in trying to teach CL (not an easy task I must add, especially if you’re constrained like I was, but that’s a different story). During that time, I always wished for a book that could introduce CL in the right way. Although myself never quite pictured what would be “the right way”. When PCL came out it got close but I think that LoL in this particular aspect is better. A very good first contact with the world of Lisp! And for all the Lispers out there, this is surely the most fun book to read :-)