Computer Science I / Modular Decomposition and Reuse
Practice question · Select all that apply

The same block of validation logic has been copy-pasted into six files. Select every consequence the lesson attributes to this.

Hints
  1. The DRY principle is about the cost of CHANGE, not the cost of running.
  2. Two options describe consequences duplication does not actually have.
Show the answer
  • B. A bug fixed in one copy remains in the other five
  • C. The six copies will drift apart over time
  • D. Any change to the rule must be made in six places
Why

Duplication multiplies the cost of every change, guarantees the copies eventually disagree, and lets a fix land in one place while the same bug survives elsewhere. It does not slow execution, each file still runs its own copy once, and it does not affect compilation. Reading DRY as a performance rule rather than a maintenance rule is the common misreading.

Read the lesson: Modular Decomposition and Reuse →

Practise Modular Decomposition and Reuse

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Modular Decomposition and Reuse