O'Reilly logo

Extreme Programming Installed by Chet Hendrickson, Ann Anderson, Ron Jeffries

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Say Everything Once and Only Once

Whenever code is duplicated, get rid of it. Make a method of it, make an object to do it, do something. Get rid of it.

Where there is duplicated code, there is usually an idea lurking: first I'll convert this one, then I'll convert that one. That idea needs to be expressed.

Where there is duplicated code, there is always an opportunity to make the program smaller. Do it.

Where there is duplicated code, there is always an opportunity for one of the duplicates to get fixed and the other one to be forgotten. Remove this opportunity.

Where there is duplicated code, there is more code to read before you understand the program. Make the job easier.

Hmm … there's duplication above. I should have said:

When there is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required