If information is written down two ways, one of the versions will soon be out of date. Therefore: Write everything once and only once. And get agreement with the team on where that one spot should be, so that people will know where to look.

As you Refactor Mercilessly and practice You Arent Gonna Need It, you ARE gonna need OAOO. So locate and fold together any duplication you find while adding the current feature.

If you apply the Open Closed Principle, Dependency Inversion Principle, and Design Patterns wisely to remove the duplication, you will improve the code, make the next feature easy to extend, reduce the odds of further OAOO cleanup, and isolate your outer design for easy review.

OAOO is also a savior from that most common of Anti Patterns, Rape And Paste Programming.

Apply this maxim to labor, also; Once And Only Once Is Not Just For Code.

Log in or register to write something here or to contact authors.