Just curious for some feedback on how you like to see code examples in a book. I tend to break up chunks of code into smaller bits, a line or two, and explain those lines. Add another chunk, explain it, and so on and so on. It works well for explaining each chunk. The problem is that you can’t see the entire code as a whole to get a feel for the larger chunk of code (let’s say 10 - 15 lines of code).
My question: do you prefer smaller chunks of code or one larger chunk that’s defined with a larger, uninterrupted block of text? As a third possibility, would you prefer the smaller set of code + the larger code block after the fact as a “here’s the whole block…” after each piece has been explained?
This is entirely a preference thing, so no right or wrong answer. Just curious for some opinions.