Dont Repeate youself:

aimed at reducing redundancy and improving code maintainability. Every piece of knowledge should have a single, authoritative representation in your system. Don't duplicate logic, data, or intent.

why DRY matters?

  • code resuability: make resuable function for repetative task
  • maintainlibilty: make chages at single place
  • error reduction : make cahge in single place

Password Validation

when to break DRY?

Two pieces of code look similar but change for different reasons or at different speeds. Code looks similar today but represents different concepts that will diverge. Premature Abstraction: Readability Issues: Different Concepts: