Some of the skills taught to first graders appear to foreshadow modern development practices. You decide.
Yesterday, my wife asked me to replace her as a volunteer in our daughter's first grade classroom. To my surprise, I found the experience relevant to my day job. Two practices of the first graders stood out: "imaginative spelling" and "sloppy copy". The first stipulated that when writing stories the students are only responsible for correctly spelling the words that they have explicitly studied. The second, encouraged students to jot down their thoughts in a stream-of-consciousness mode and then do another pass focusing on correctness and neatness of letters.
Holy cow! The kids were being taught the practice refactoring! Just as in literary writing, episodes of stream-of-consciousness coding are an important part of the process, but unlike writers, many developers feel that their code is good enough and that they are measured solely on the quantity of implemented features. This is a short-sighted view. For example, the deficiency I most often spot on projects is the lack of knowledge and practice of the the "compose method" refactoring which is the number one cure for unreadable code. See: http://www.industriallogic.com/xp/refactoring/composeMethod.html
At the end of the day, customers need to define that "done" means for any particular piece of software. Most customers - often with the help of a trusted adviser - will opt for code that is readable, DRY, layered, modularized, loosely coupled and testable. Getting there usually involves significant code refactoring and should be treated as a sign of a mature development culture. In such a culture you will often spot practices such as peer code reviews, pair-programming, and test-driven development -- they all help us stay honest and disciplined. Now, honestly, is your shop still shipping "sloppy copy"?
>>Getting there usually involves significant code refactoring and should be treated as a sign of a mature development culture.
I'm afraid that highlights all that seems wrong to me in 'agile' coding culture. We produce code that is 'readable, DRY, layered, modularized, loosely coupled and testable.' and involves surprisingly little 'refactoring'. This is down to a culture in our company of 'getting it right first time'.
@John Do you refactor as you code? If your code is so modularized that is never needs refactoring when new features are added, I would love to see it. ;) All I have seen so far is lack of refactoring leading to technical debt that saps the spirit out of the project.