Cuis-Smalltalk / TheCuisBook

A book about Cuis Smalltalk
64 stars 9 forks source link

SpaceWars! example sections sometimes rely on refactoring before it has occured #40

Open pwplusnick opened 3 months ago

pwplusnick commented 3 months ago

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?

hilaire commented 3 months ago

I will take a look. Thanks to report.

hilaire commented 3 months ago

Yes it will be very helpful to make the examples more consistent and less confusing for the reader. Please go ahead Thanks