TheCuisBook
TheCuisBook copied to clipboard
SpaceWars! example sections sometimes rely on refactoring before it has occured
I've been going through the book the last couple of nights, and following along. I'm nearing completion. It is an excellent resource! One thing I've noticed about the end of chapter SpaceWars example is that it will sometimes provide examples that would break the code if it were used in the state that the previous chapters had left it. For example, in Chapter 4 example 4.21, position
is declared as a method variable, when it was previously left as an instance variable; in Chapter 5 example 5.10, it sends self morphPosition
before the class is a PlacedMorph
subclass.
I would be willing to go through the examples this weekend, and re-work the necessary code examples so that the same concepts are being driven, but the code only builds upon what was previously left rather than foreshadowing future refactors. Is this something that would be helpful?