|
|
|
|
|
by jeremiep
3462 days ago
|
|
That isn't composition to me but sequencing. Function composition yields a function, not the result of applying the functions. Either you have an object with all of garnish(), strain() and whatnot on it, or each method returns the object to handle the next step in the chain. Either methods don't scale at all without modifying existing code. The real difference is that function composition gives you a reusable function you can further compose while objects keep piling up methods until you're left with god objects or indirection hell. |
|