Skip to main content
Sourced comment taken from elsewhere; fixed punctuation.
Source Link

A common misunderstanding with the DRY principle is that it is somehow related to not repeating lines of code. The DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system", it'sThe DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system". It's about knowledge, not code.

LoginPage knows about how to draw the page for logging in. If EditInfoPage knew how to do this then that would be a violation. Including LoginPage via composition is not in any way a violation of the DRY principle.

The DRY principle is perhaps the most misused principle in software engineering and it should always be thought of not as a principle for not duplicating code, but as a principle for not duplicating abstract domain knowledge. Actually, in many cases if you apply DRY correctly then you will be duplicating code, and this is not necessarily a bad thing.

A common misunderstanding with the DRY principle is that it is somehow related to not repeating lines of code. The DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system", it's about knowledge, not code.

LoginPage knows about how to draw the page for logging in. If EditInfoPage knew how to do this then that would be a violation. Including LoginPage via composition is not in any way a violation of the DRY principle.

The DRY principle is perhaps the most misused principle in software engineering and it should always be thought of not as a principle for not duplicating code, but as a principle for not duplicating abstract domain knowledge. Actually, in many cases if you apply DRY correctly then you will be duplicating code, and this is not necessarily a bad thing.

A common misunderstanding with the DRY principle is that it is somehow related to not repeating lines of code. The DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system". It's about knowledge, not code.

LoginPage knows about how to draw the page for logging in. If EditInfoPage knew how to do this then that would be a violation. Including LoginPage via composition is not in any way a violation of the DRY principle.

The DRY principle is perhaps the most misused principle in software engineering and it should always be thought of not as a principle for not duplicating code, but as a principle for not duplicating abstract domain knowledge. Actually, in many cases if you apply DRY correctly then you will be duplicating code, and this is not necessarily a bad thing.

formatting: quote ≠ code
Source Link
Konrad Rudolph
  • 13.1k
  • 4
  • 58
  • 76

A common misunderstanding with the DRY principle is that it is somehow related to not repeating lines of code. The DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system""Every piece of knowledge must have a single, unambiguous, authoritative representation within a system", it's about knowledge, not code.

LoginPage knows about how to draw the page for logging in. If EditInfoPage knew how to do this then that would be a violation. Including LoginPage via composition is not in any way a violation of the DRY principle.

The DRY principle is perhaps the most misused principle in software engineering and it should always be thought of not as a principle for not duplicating code, but as a principle for not duplicating abstract domain knowledge. Actually, in many cases if you apply DRY correctly then you will be duplicating code, and this is not necessarily a bad thing.

A common misunderstanding with the DRY principle is that it is somehow related to not repeating lines of code. The DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system", it's about knowledge, not code.

LoginPage knows about how to draw the page for logging in. If EditInfoPage knew how to do this then that would be a violation. Including LoginPage via composition is not in any way a violation of the DRY principle.

The DRY principle is perhaps the most misused principle in software engineering and it should always be thought of not as a principle for not duplicating code, but as a principle for not duplicating abstract domain knowledge. Actually, in many cases if you apply DRY correctly then you will be duplicating code, and this is not necessarily a bad thing.

A common misunderstanding with the DRY principle is that it is somehow related to not repeating lines of code. The DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system", it's about knowledge, not code.

LoginPage knows about how to draw the page for logging in. If EditInfoPage knew how to do this then that would be a violation. Including LoginPage via composition is not in any way a violation of the DRY principle.

The DRY principle is perhaps the most misused principle in software engineering and it should always be thought of not as a principle for not duplicating code, but as a principle for not duplicating abstract domain knowledge. Actually, in many cases if you apply DRY correctly then you will be duplicating code, and this is not necessarily a bad thing.

Source Link
wasatz
  • 3.5k
  • 3
  • 20
  • 20

A common misunderstanding with the DRY principle is that it is somehow related to not repeating lines of code. The DRY principle is "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system", it's about knowledge, not code.

LoginPage knows about how to draw the page for logging in. If EditInfoPage knew how to do this then that would be a violation. Including LoginPage via composition is not in any way a violation of the DRY principle.

The DRY principle is perhaps the most misused principle in software engineering and it should always be thought of not as a principle for not duplicating code, but as a principle for not duplicating abstract domain knowledge. Actually, in many cases if you apply DRY correctly then you will be duplicating code, and this is not necessarily a bad thing.