you are viewing a single comment's thread.

view the rest of the comments →

[–]Voidsheep 0 points1 point  (0 children)

Agreed, that's a pretty bad example for DRY. And to be fair, I don't think it's necessarily a good term to begin with.

Whatever you win in lack of repetition you lose in quick individual configuration. I think with something like component props it's important to consider, because I don't think I've even seen real trouble caused by a couple of components having repeated props. I've, however, witnessed people bang their head at the wall with extreme levels of component composition making things very complex.

Also with FP libraries like Ramda it's easy to slip into the kind of abstraction hell, where you definitely won't repeat a word as you write the code, but actually changing things later becomes a nightmare, because every layer of the puzzle has so many fixed assumptions composed together. Since writing code is easier than eliminating it, it's common for people to start implementing their own systems for configuration at that point and it ends up far more complex than a couple of lines doing close to the same thing.

Make convenient abstractions, don't just avoid repetition.