Principles
DRY: Don't Repeat Yourself
DRY means every piece of knowledge, such as a business rule, lives in exactly one place in the code. When a rule is copied into several places, changing it means finding every copy, and the copy you miss becomes a bug. These lessons take a free shipping rule that three classes check on their own and move it into one home, one small refactoring at a time.
Pick your language
When to use it
Use it when
One business rule, number or decision shows up in more than one feature.
Skip it when
Two lines look alike but follow different rules, like a shipping fee and a gift wrap fee that both cost 4.99.
Spot it by
The same literal or condition in several classes, and changes that start with a search.