3 ms·
Glad we're on the same page. I think. So state would be dealt with in a similar approach than the command pattern? Sounds exciting. I guess where I come from
by keyle 13y ago
Glad we're on the same page. I think.
So state would be dealt with in a similar approach than the command pattern?
Sounds exciting.
I guess where I come from is the scare when a pure function gets littered with impurity much later on, and all we have to warn us is a unit test. No matter how big the comment is above the method, nothing stops a developer from sticking a global variable in it, and it's out the window.
This forces code reviews to be lengthy, etc. If on the other hand we had a @pure section and @everything_else section, I feel this would make things easier to reason about... We could also measure the % of pure vs non-pure code, as code quality. All of this in an object oriented language of course. I'm no fan of Haskell.
- seanmcdirmid 13y agoYou might want to check out Koka [1], which includes an effect system to separate pure and effectful computation. I believe there is also a demo of it online [2]. [1] http://research.microsoft.com/en-us/projects/koka/ http://research.microsoft.com/en-us/projects/koka/ [2] http://www.rise4fun.com/koka/tutorial http://www.rise4fun.com/koka/tutorial