3 ms·
It took me a long time and many thousands of lines of code written, read and re-written in order to understand one thing: Code is supposed to reflect the i
by bheadmaster 3y ago
It took me a long time and many thousands of lines of code written, read and re-written in order to understand one thing:
Code is supposed to reflect the intention.
Good code reflects that intention smoothly, like a well-written paragraph of a book reflects the events that happened in the story.
DRY makes sense semantically, when a piece of code always needs to be the same as another piece of code - that's when you isolate it into a function with a semantically meaningful name and behavior. Applying DRY without understanding and indiscriminately leads only to confusion and needless complexity.