News for hackers. Stuff that matters.
Re:Functional Programming Doesn’t Work (and what to do about... by foldr on Tuesday December 29, 2009 @05:15AM (#1020314)
>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.

Re:Functional Programming Doesn’t Work (and what to do about... by omouse on Tuesday December 29, 2009 @11:40AM (#1020707)
The 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?

Re:Functional Programming Doesn’t Work (and what to do about... by foldr on Wednesday December 30, 2009 @05:30AM (#1022252)
>Modifying the language spec...is that pure or impure I wonder?

Neither, it's completely orthogonal to the pure/impure distinction.

Re:Functional Programming Doesn’t Work (and what to do about... by ajross on Tuesday December 29, 2009 @12:58PM (#1020888)
Remember that the "FP approach" can be used in so-called "imperative" languages too. The reverse isn't as true.
Re:Functional Programming Doesn’t Work (and what to do about... by omouse on Tuesday December 29, 2009 @01:06PM (#1020909)
The 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.
Re:Functional Programming Doesn’t Work (and what to do about... by foldr on Wednesday December 30, 2009 @05:31AM (#1022253)
Pure has a specific technical meaning here relating to the absence of side effects.

http://en.wikipedia.org/wiki/Pure_function