next up previous
Next: About this document ... Up: Assignment 8: Process Objects Previous: Restructure your code

Review the code

1.
After reorganizing, review the code for things that can be cleaned up or places where you can take advantage of the new structure. For example, I found that when all the state variables are visible from all functions (since they are instance variables) I was able to reduce the number of arguments I passed around, which made it easier to create new submethods.

Also I was able to generate better error messages, because even deeply nested methods were aware of global state.



Allen B. Downey
1999-10-28