Higher-order functions either take other functions as arguments or return them as results. The closure is an inner function which can access variables of parent function’s, even after the parent function has executed. Therefore, first-class functions can appear anywhere in the program. ‘First-class function’ is a definition, attributed to programming language entities that have no restriction on their use. Maintainability is a simple term which means FP programming is easier to maintain as you don’t need to worry about accidentally changing anything outside the given function. Apart from it, the modules can be tested separately which helps you to reduce the time spent on unit testing and debugging. Small modules can be coded quickly and have a greater chance of re-use which surely leads to faster development of programs. In FP term it is called Referential transparency. So, you will know what may or may not have happened during the program’s execution, and its side effects. Referential transparencyįunctional programs should perform operations just like as if it is for the first time. Immutable Data means that you should easily able to create data structures instead of modifying ones which is already exist.
0 Comments
Leave a Reply. |