|
|
|
|
|
by nendroid
2051 days ago
|
|
I disagree with the higher order functions thing. Writing functions that receive other functions as input can lead to over complicated code that's really hard to read. It's literally the same thing as dependency injection just with functions instead of objects. Use sparingly. I would avoid altogether except for common ones like map, reduce and filter. Functional programming promotes the idea of composition of morphisms and point free programming. I would use this in place of Object composition/dependency injection/higher order functions or whatever you want to call it. |
|
I work in FP languages, and I find this type of code extremely intuitive and easy to understand.
I suspect that you are just not used to thinking this way, and that with more familiarity, you would not have this opinion.