4 ms·
I think more likely is to actually have too much abstraction.
by asimpletune 6y ago
I think more likely is to actually have too much abstraction.
- AnimalMuppet 6y agoEither can be a problem. Too much abstraction and you're writing FooFactoryFactoryFactory. Too little, and you're repeating yourself. Somewhere between the extremes is a sweet spot. The problem is that, as the project continues over time, the sweet spot moves...
- RangerScience 6y agoNah. It's always about 4 layers. Hardware/services/data stores/etc, wrappers/models/components, business logic / application, ops/deploy. If you nest your models/components deep enough that they're forming new abstraction layers, you're nesting them too deep. Backup and use mixin-style stuff instead. If your business logic or application are nesting pretty much at all, then you haven't succeeded at making good choices in your models/components.
- asimpletune 6y agoAgreed, and I’d add that code duplication is hardly a big problem. It’s kind of like if I legitimately see a lot of code duplication, then I have enough data points to do the right thing. On the other hand, abstracting early to avoid code duplication is worse.
- RangerScience 6y agoHmm... I think you might be right. Or, at least, that the problem that is and the problems that go with code duplication are easier to resolve than those that show up with shit abstraction. Maybe... Duplication is a code smell, but shit abstraction is a code problem...?