3 ms·
Functional programming is about composing functions with functions. Just like OOP is about composing objects with objects. FP and OOP is not in conflict with e
by lightblade 13y ago
Functional programming is about composing functions with functions. Just like OOP is about composing objects with objects.
FP and OOP is not in conflict with each other and you can certainly use both. FP is more in conflict with procedural programming. With procedural programming you are teaching the computer how to do things step by step (for i while i < len i++). With FP, you declare what you want to be done, and the computer figure it out on its own on how to get it done. An example would be for each loop on a collection. You are not telling the computer to increment index. You just want to iterate each element. The computer is free to spawn 20 threads to iterate the collection, so long that it accomplish the goal of your expression.