In the functional programming paradigm, a function has a type and it is treated in the same way as other types, such as Int
, String
, and Class
. The function can be assigned to a variable, passed as an argument to another function, and returned from a function as a result type. The main goal is to split the code into small, standalone functions. The perfect function has no side effects and operates only with arguments that were passed to it.
In the functional programming style, you describe what you want to do and not how you want to do it.
Functional programming is great for data transformation and data manipulation. This is because you are able to split code into smaller parts. You can often reuse some routine boilerplate code.