3 ms·
FP doesn't just avoid global variables, it avoids local variables a lot of the time: you compute things from the function's arguments directly. f(a,b,c) always
by pjc50 12y ago
FP doesn't just avoid global variables, it avoids local variables a lot of the time: you compute things from the function's arguments directly. f(a,b,c) always returns the same thing for the same values of a, b, and c and does not modify them.
FP hides state behind the concept of monads. This tends to make state-heavy systems harder. Often small embedded systems follow the "state machine" design pattern.