3 ms·
These days I prefer SPOT (single point of truth) over DRY. I find DRY tends to encourage people to use hideously complicated abstractions to avoid code that eve
by fooblitzky 9y ago
These days I prefer SPOT (single point of truth) over DRY. I find DRY tends to encourage people to use hideously complicated abstractions to avoid code that even looks similar. It's also way easier to refactor some duplicated code than to try and untangle complicated abstractions.
SPOT more accurately identifies the pain point of duplicated code - if there is an algorithm or configuration value that needs to be specified, than that should just be in a single place, everything consistent and easy to change.
- HelloNurse 9y agoGood name, it helps with distinguishing things that are meant to be the same (e.g a single implementation of an encryption algorithm, used in various places) and things that are distinct but accidentally identical (e.g. permutations in different stages of that algorithm).
- gowld 9y agohttps://en.wikipedia.org/wiki/Don%27t_repeat_yourself https://en.wikipedia.org/wiki/Don%27t_repeat_yourself > The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system". How is SPOT different?
- dllthomas 9y agoI'm unclear as to whether the parent is preferring the name SPOT for the same concept, or preferring what they are presenting as a different concept (which, as you note, seems to match the original definition of DRY).
- zaarn 9y agoI think SPOT is different in that DRY has become misunderstood, so the "Single Point of Truth" brings the proper point across a bit better.