by chriswarbo · 9y ago · 0 comments
> I don't want to think about how that component exists in a vast web of generic CSS utilities and abstracted decoupled code. Copy and pasting CSS properties is cheap. Conversely overly abstracting your presentational code is a short cut to expensive CSS spaghetti.
You probably know this, but based on your phrasing I just wanted to point out that DRY isn't for mechanically compressing source code; it's for removing 'out of sync' issues, like causing bugs when we forget to update this copy of a procedure when we altered that copy.
Removing such 'conceptual repetition' makes life easier, since (a) we don't need to remember any couplings that need to be kept in sync (this is the "obvious" benefit), but equally importantly (b) if there are multiple copies of something, we don't have to worry about the other ones since they're not related.
It's perfectly fine if many similar chunks of code are scattered around a project, as long as they don't have to be 'kept in sync'. The whole point of "components" (/modules/packages/etc.) is to be self-contained, so it's perfectly reasonable to avoid coupling them together in a "vast web".
Wrong abstraction < Redundancy < Elegant abstraction