Chapter 5 done! Get a limited-time discount
Hello!
It's been a while since you've heard from us. And that's because we've been hard at work on the book.
TL;DR: Chapter 5 is done, we've raised the price to $29, but for the next two weeks only, mailing list subscribers can get it for $19! Checkout code: K3ODGYNA.
What's changed
A few days ago, we very quietly published a major update:
- Chapter 5: Functions (formerly "Global Variables and Functions") is now complete! 🥳
- Along with that, we did a big refactoring in the code for Chapters 1–4:
- We eliminated the dependency on uvu (a testing library), and now use the built-in
node:test
module everywhere. - In Chapter 4, the handling of local variables has changed a bit, in order to simplify the transition in Chapter 5.
- We eliminated the dependency on uvu (a testing library), and now use the built-in
- We also reviewed the other chapters and made some small improvements.
Overall, the book is close enough to being done that we're now calling it "beta", and have raised the price to $29.
About the refactoring
With the code in the book, one of our goals is: "as simple as possible, but no simpler".
But there are some parts of the code that start simple, and grow more complex chapter by chapter. For code like that, there is a tradeoff. If it starts as simple as possible, then it may be necessary to do a serious refactoring later in the book — which requires explanation. On the other hand, if the first version that's presented is closer to the final structure that it needs to have, then the code may appear to be needlessly complex.
Sometimes, we don't the sweet spot. In this case, we decided to refactor the code related to the symbol table. When it's introduced in Chapter 4, it only supports local variables, and doesn't have to deal with nested scopes. But that led to a fairly involved refactor in Chapter 5.
So: we refactored the code in Chapter 4 and 5, making the initial version of the code — formerly a function named localVars, now buildSymbolTable — closer to its final form.
What's next
We've currently got three chapters in progress:
- Global Variables and Imports
- Comparisons, Conditionals, and Loops
- Reading and Writing Memory
We expect to finish these chapters in the next few months, and will let you know when we do!
Wherever you are, we hope you're enjoying some wonderful 🌱spring (or 🍂fall) vibes —
✌️,
Pat & Mariano