3 ms·
Even more simply - are you writing code for a von Neumann architecture (http://en.wikipedia.org/wiki/Von_Neumann_architecture http://en.wikipedia.org/wiki/Von_N
by mixu 16y ago
Even more simply - are you writing code for a von Neumann architecture (http://en.wikipedia.org/wiki/Von_Neumann_architecture http://en.wikipedia.org/wiki/Von_Neumann_architecture ), or something more abstract?
To my understanding the issue is not whether "state" has side effects (e.g. your global vs. local example), but rather whether there is any concept of "state" (e.g. shuffling stuff from one memory slot to another).
My experience is from Prolog, where the statement "X is X + 1" results in an error, because once unified, the variable X cannot be modified - X is not a memory slot. Once you try to let go of the idea of a machine with memory slots, alternative-paradigm programming gets a little bit easier. Of course in practice state is often needed, so it often gets added through some mechanism.
- meric 16y agoThat's a good explanation. My explanation is catered to people accustomed to the von Neumann architecture, however. :)