I chose to read the new third edition of Programming in Lua as my first Book of the Week. Today I present my thoughts about the book and my choice for next week’s book, which I intend to write every Sunday until I blow it off to inevitably play some Elder Scrolls game.
I’ll Just Go Ahead and Say It
Programming in Lua (PiL) is the best book about a programming language that I’ve ever read. It’s easy to read. It’s easy to understand. It’s full of great examples. And it’s comprehensive while remaining terse and to-the-point.
If you are familiar with the K&R C book then know that Programming in Lua has the same efficiency of form and style. Except, unlike K&R C, PiL is actually relevant. Zing!
A Brief Overview
Programming in Lua presents everything about the Lua language. Author Roberto Ierusalimschy is one of the creators and architects of Lua, lending an expert’s perspective to the book. He breaks the chapters into four major sections:
The first teaches the fundamentals of Lua. It introduces the reader to the syntax, semantics, basic data types, and so forth.
The second builds upon the reader’s new knowledge of Lua by teaching advanced topics, like how to create sandboxes using environments and how to write object-oriented code by using metatables.
The third discusses the Lua standard library, with examples of common tasks that the library covers.
And the final section explains the C API. These chapters explain how to interact with Lua from within C programs and how to embed and extend the language from a host program.
At just over three-hundred fifty pages these four sections show you Lua inside and out. You can pick up PiL with no prior knowledge of Lua and by the end you will understand not only how to write Lua programs, but also how to embed the entire Lua environment inside your own software.
Why I Enjoy This Book
Ierusalimschy’s style of writing defines the greatness of Programming in Lua. The book reads more like a wise and meditative exposition of the subject and less like the dry technical babble of its peers. Some programming books attempt to cushion the learning experience with humor or other distractions. But PiL eases the task with its sheer clarity and precision.
Programming in Lua flows effortlessly from topic to topic, carefully building upon and reinforcing its lessons along the way. I find it easy to get swept up reading, and before I know it I’ve turned through six or seven chapters. To me that speaks volumes—that PiL takes what is realistically a serious and dull subject, and teaches it in a way that is engaging and engrossing.
PiL tells me everything I want to know about Lua, but a lot of programming books tell me everything about their respective subject. What separates PiL is that is also manages to be entertaining. It isn’t perfect; I do feel that parts describing the standard library could benefit from more detail, and the open-ended questions at the end of chapters in the third edition can be thought-provoking but can also annoy those readers expecting factual question-and-answer sessions.
So the book is not perfect. But it is impressive.
Next Book of the Week
Next week I will read Postmortems from Game Developer by Austin Grossman. And yes, that is the actual title—‘Game Developer’, singular. If you have any suggestions for great programming or game developement/culture books then please mention them in a comment.