4 ms·
The usual issue isn’t the typing, but the fact that you need to make sure you identified and updated every site correctly. DRY isn’t about reducing LoC
by setr 3y ago
The usual issue isn’t the typing, but the fact that you need to make sure you identified and updated every site correctly.
DRY isn’t about reducing LoC
- marcus_holmes 3y agoBut the same is true with the concise code. Only with that you have to unentangle each chain to work out if it needs to be refactored or not, and that's hard.
- setr 3y agoYou’re talking about code that’s been reduced from 10 lines to like a one-liner; whether it becomes more understandable or not (and whether to keep it as such) is a matter of taste. But not copying and pasting code by merging common logic is a matter of reducing the number of times you can fuck up, and reducing the number of “accidentally/unnecessarily special-cased” scenarios. You’re trying to reduce the amount of information needed to understand the codebase. The former is preserving the information, it’s just writing it more densely.