3 ms·
The confusion is that you are thinking of function in the programming language sense (i.e. A subroutine ) rather than in the mathematical sense (i.e. A function
by RcouF1uZ4gsC 11y ago
The confusion is that you are thinking of function in the programming language sense (i.e. A subroutine ) rather than in the mathematical sense (i.e. A function called with the same arguments always returns the same value). The mathematic definition of function necessitates persistent data structures (i.e. You do not modify the dataset but return a new dataset with the modifications).
- fpoling 11y agoYet persistent data do not imply functional programming. For example, one can work with persistent data structures in Java using global variables to pass references to data structures. One can also implement algorithms from the article using explicit stack to avoid recursion. Yet such atrocities will not change the conclusion of the article that the code will be cache-efficient as long as the runtime is sufficiently smart. So my assumption (which could be wrong) is that by using the word "functional" that article unnecessary restricts its auditory. For example, a Java programmer would not even bother to open it assuming this is something relevant at best to Haskell or F#. I definitely had such expectation.