3 ms·
The problem with lots of simple code is now there’s 5,000 slightly different ways of doing the same thing. You end up trying to wrangle it with a mess of code g
by et1337 3y ago
The problem with lots of simple code is now there’s 5,000 slightly different ways of doing the same thing. You end up trying to wrangle it with a mess of code generation and linters.
- marcus_holmes 3y agoYeah, this is something I think feels like a bigger problem than it actually is. If I change the way I'm handling something, it is a lot of typing. But it's just typing. No big deal.
- setr 3y agoThe 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.
- dd82 3y agoits a lot of repetitive noise. Coming from other languages like python and java, this is a good example of normalization of deviance to me.