by dwhitty · 15y ago · 0 comments
"Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function."
- John Carmack (Twitter) http://twitter.com/#!/ID_AA_Carmack/status/53512300451201024
Not "sometimes", "mosttimes"!
Here's a good series of articles about it: http://prog21.dadgum.com/23.html
Even for gameplay code, it could be nice to have explicit tracking of what the mutable state is, to prevent bugs. He has some fascinating slides about this, if you google for "The Next Mainstream Programming Language". Extensive discussion on Lambda the Ultimate here:
http://lambda-the-ultimate.org/node/1277
Definitely one of the most interesting things I've seen in a while.
In a mixed model, you can have a mutable state but still have a large bank of trustable, testable, parallelizable behaviors defined in pure or deterministic functions with well defined contracts of input and output states.