“Don’t try to create and analyze at the same time. They're different processes.”
That’s the eighth rule from composer John Cage’s 10 rules for students and teachers.
In similar fashion, software engineer Kent Beck has his metaphor of the two hats: you should either add function or refactor. When you wear the refactoring hat, you preserve observable behavior. When you add function, you extend or break this behavior. You rebuild or you restructure.
Cage and Beck’s main point isn’t the dualism of discovery and editing. Their argument is that you will forget this duality in your day to day work. At least that's probably why Cage decided to include the idea in his 10 rules and Beck constructed a metaphor instead of a simple principle.
When you forget that create and analyze are different processes you end up spinning your wheels. You try to be an artist and an editor at the same time. You end up second guessing your every step.
Write. Edit. Write. Edit.
Extend. Refactor. Extend. Refactor.
Create. Analyze. Create. Analyze.
Try to replace those dots with an ampersand and you’re exposing yourself to more context switching than you actually have to.
PS. If you want to try turning Beck’s metaphor into a habit, consider reading my post "Using TDD as a Mind Hack" from last year.