3 ms·
As the books document complete implementations, they do feed you the code, and it is easy to fall to the trap of just copying the code from the book. I think th
by signaru 3y ago
As the books document complete implementations, they do feed you the code, and it is easy to fall to the trap of just copying the code from the book. I think the best approach is to port it to another implementation language as you read the book. However, compared to other books I've seen these are more "granular" in the code explanations so you're simulating the authors' coding thought process instead of just looking at big blocks of finished code.
In particular in Crafting Interpreters, there are many parts where you go back and revise the code from previous chapters as some language features/concepts are introduced in subsequent chapters (my memory of Writing an Interpreter/Compiler in Go is not that fresh).
I think it is a good sign that these books start with "int main()" (or it's equivalent). Other books I've seen start by describing functions in isolation, so they are not immediately testable, and it encourages the reader to just get the finished codebase to have something to play with.