Traditionally, computer science students are told to keep their functions simple. It is often said that one function should correspond to one single action. Indeed, the more a function has cyclomatic complexity, the harder it is to reuse, maintain and test. The more a function becomes a purely logical being that has no real-world roots in a clearly identifiable action, the harder it is to grasp and use in combination with other functions.
Simplifying functions
Functional programming principles
The functional programming (FP) paradigm pushes this reasoning further by considering computational design as being based on mathematical functions and the immutability of state and data. FP's guiding principle is that the entire...