4 ms·
FP-style castle of abstractions is just as bad as OO-style castle of abstractions. A "function that returns a function that returns a function that returns a...
by SPBS 3y ago
FP-style castle of abstractions is just as bad as OO-style castle of abstractions. A "function that returns a function that returns a function that returns a..." is just as bad as an "AbstractFactoryManager that manages an AbstractFactory that produces an Abstract thing..." etc.
Don't write code that is so far removed from the actual business data that it becomes hard to reason about cause and effect.
- agentultra 3y agoThat's called indirection and I agree. Abstraction is something else entirely and is usually what you want. Think more like, "things that have provable laws." Eg: concatenating two lists results in a list that is at least as long as the longest input list, for all lists. Concatenation is the operation on lists that is the abstraction... once you have defined it you no longer have to think in terms of loops and building intermediate lists.
- RussianCow 3y agoAbstraction very often leads to indirection, so I don't think "something else entirely" is an accurate description.