Deely@programming.devtoProgramming@programming.dev•Melody 0.19.0 | A language that compiles to regular expressions and aims to be more readable and maintainableEnglish
1·
1 year agoIt make sense in any project that created by more than one person I suppose.
Erm. Duplication of code is ok. Removing absolutely every duplicate function is just premature optimization imho.
If you have two different customers with slightly different workflow then go ahead and create two mostly the same functions. When you will have 4 different customers with slightly different workflow, then its a time for refactoring, maybe extract basic same functionality into separate function/object, maybe introduce dynamic workflow using finite automata, maybe extract these functionality to separate modules… but never do it prematurily.
Imho, sometimes ,removing of duplication very much increases complexity and code became hard to understand and hard to modify.