A coding principle stating that every piece of knowledge should have a single, authoritative representation in a system. When logic is duplicated across a codebase, any change must be made in multiple places, increasing the risk of inconsistency and bugs.
Illustrated this with a value-added tax example: rather than scattering a raw multiplier throughout the code, extracting it into a named method means the logic lives in one place and can be updated once. The opposing backronym is WET (Write Everything Twice), used humorously to describe code that violates DRY.
Illustrated this with a value-added tax example: rather than scattering a raw multiplier throughout the code, extracting it into a named method means the logic lives in one place and can be updated once. The opposing backronym is WET (Write Everything Twice), used humorously to describe code that violates DRY.