
Here are some reasons

1 / You can't see the whole picture
For example, you don't know yet will you use your code or not, since you're just trying things out, making experiments/researching.
There is no need to make your code clean and exceptionally DRY: it might happen you'll remove it soon.
For example, you don't know yet will you use your code or not, since you're just trying things out, making experiments/researching.
There is no need to make your code clean and exceptionally DRY: it might happen you'll remove it soon.
2 / Your customer doesn't yet know what he wants.
This is very similar to when UI designers first do some prototypes/mockups.
Today you make your code perfectly DRY, tomorrow you show the work to your customer and he says: no, I decided it won't work, we need something else
This is very similar to when UI designers first do some prototypes/mockups.
Today you make your code perfectly DRY, tomorrow you show the work to your customer and he says: no, I decided it won't work, we need something else
3 / Your copy-paste is actually 3-4 lines of code.
Don't go mad with DRY:
- if you have 10 site sections,
- in every section, you need to get a list of users,
- the repeated code is actually function name + API call
with 3-5 lines of code.
then it's not copy-paste.
Don't go mad with DRY:
- if you have 10 site sections,
- in every section, you need to get a list of users,
- the repeated code is actually function name + API call
with 3-5 lines of code.
then it's not copy-paste.