3 ms·
You DRY up code by writing indirection. That's the expense of all abstractions. You can't believe that all indirection is worth it at all costs, so I'm not sure
by always_good 9y ago
You DRY up code by writing indirection. That's the expense of all abstractions. You can't believe that all indirection is worth it at all costs, so I'm not sure what point you're belaboring.
- naasking 9y ago> You can't believe that all indirection is worth it at all costs I think I've been pretty clear about the costs and when this is worth it, particularly in my first post in this subthread, which I'll quote here: > That said, the moment you have to start adding parameters in order to successfully factor out common code, ie. to select the correct code path taken depending on caller context, that's when you should seriously question whether the code should actually be shared between these two callers. More than likely in this case, only the common code path between two callers should be shared. Or if you want a more concise soundbite: refactor if your indirection is actually a clear and coherent abstraction.