4 ms·
"DRY is the most obvious one, but one that may be less obvious is for better testing." Isn't that why we just write functions? Turning simple functions into en
by gizmo385 11y ago
"DRY is the most obvious one, but one that may be less obvious is for better testing."
Isn't that why we just write functions? Turning simple functions into entire modules just adds an unnecessary level of abstraction that helps nobody.
- tedmiston 11y agoOf course that's why we write functions. But we can't share a function with others and across projects... so we make it into a module to do that. It's like (micro)crowdsourcing (the smallest components of) the standard library that JavaScript never had. Some bit of logic could go from being DRY in one project, to DRY in all of my projects, ... to eventually be DRY in all projects. It's globally DRY.
- lolidaisuki 11y ago>Of course that's why we write functions. But we can't share a function with others and across projects... so we make it into a module to do that. Sounds an awful lot like a library.