6. Four Rules of Simple Design
1. Tests Pass
2. Expresses Intent
3. No Duplication (DRY)
4. Small
7. Don't Repeat Yourself
This rule isn't about code duplication; it is about knowledge
duplication:
Every piece of knowledge should have one and only one
representation.
— The Pragmatic Programmer2
2
http://pragprog.com/book/tpp/the-pragmatic-programmer
8. Small
• Any vestigial code that is no longer used?
• Any duplicate abstractions?
• Extracted too far?
9. Conway's Game of Life
1. If a living cell has less than two living neighbors, it will die.
2. If a living cell has two or three living neighbors, it stays alive.
3. If a living cell has more than three living neighbors, it will
die.
4. If a dead cell has exactly three living neighbors, it becomes
alive.