8 ms·
>In FP, you would probably pass those variables around. The point is that you might have to rewrite every part of the program in order to "pass around" those v
by foldr 17y ago
>In FP, you would probably pass those variables around.
The point is that you might have to rewrite every part of the program in order to "pass around" those variables, where as in an impure language with global variables, this sort of major rearchitecting is not going to be necessary.
- omouse 17y agoThe pure vs. impure stuff is a red herring. It's meant to throw you off the scientific trail. If there are merits to the FP approach, as there are, then one or two drawbacks in a few of the languages aren't a problem. If there are multiple problems with the FP approach, then we discard it and toss out the languages that use it or modify them to only use the useful subset of that approach. With what little information we have in this example, it would be best to modify the language so that it includes those two low-level functions in its specifications and make those global variables they require. Modifying the language spec...is that pure or impure I wonder?
- ajross 17y agoRemember that the "FP approach" can be used in so-called "imperative" languages too. The reverse isn't as true.
- omouse 17y agoThe reverse is true. Just modify the language. I don't see why people are insisting on this "purity" in approaches. It's obviously leading to difficulties.
- foldr 17y agoPure has a specific technical meaning here relating to the absence of side effects. http://en.wikipedia.org/wiki/Pure_function http://en.wikipedia.org/wiki/Pure_function
- foldr 17y ago>Modifying the language spec...is that pure or impure I wonder? Neither, it's completely orthogonal to the pure/impure distinction.