What is free variable?
"Free" is relative to "Bound ". Function parameters are "Bound" to a function; local variables/functions/classes are "Bound" to a function. A variable which is defined out of a function is "free" for this function.
Why is free variable harmful?
Free variables make a function depend on outside scopes. when a programer reads a function with some free variables, he/she has to go to the definition of a free variable to see what it means. furthermore, he/she will worry about whether there are other operations on this variable at somewhere else.
Personally, in terms of programming, I wocould rather to know what a function does,ExplicitlyFrom the parameters I give it. read/write operations of free variables inside a function are indeedImplicitOperations, which is like undercurrent water, you never know how it flows (unless dive in to read through all the codes ).
Functional programming cuts down free Variables
most functional programming controls ages do limitations on variable assignment ( side effects ). although I think it's a "hypercorrection", it does cuts down free variables. in functional programming, functions are much like State Transformations, which is quite direct and expressive. data flows are quite direct and expressive in this way.